Base solution for your next web application
Open Closed

Unique Name set in Object and Respective #769


User avatar
0
Hasan created

Hello Sir

This could be the simplest question but would like to ask you how to do that

I have a object called Brand

[Table("Brands")]
    public class Brand : FullAuditedEntity,IMustHaveTenant
    {
        public virtual string Name { get; set; }

        public virtual bool IsActive { get; set; }
        public virtual int TenantId { get; set; }
    }

I want to set the Name as Unique. How to achieve that in ABP ZERO

I am able to see that in RoleService that it throws the error at the place in Method CreateRoleAsync
CheckErrors(await _roleManager.CreateAsync(role));

Can you please let me know how to achieve that ?


2 Answer(s)