예제 #1
0
        public async Task CreateAsync(BRole role)
        {
            var dRole = role.ToDbRole();

            await InsertAsync(dRole);

            role.Id = dRole.Id;
        }
예제 #2
0
        public async Task UpdateAsync(BRole role)
        {
            var dRole = await GetAsync(role.Id);

            if (dRole != null)
            {
                await UpdateAsync(dRole);
            }
            else
            {
                throw new RoleReferenceNotFoundException("The role reference does not exist");
            }
        }
예제 #3
0
 public static DRole ToDbRole(this BRole role) => new DRole
 {
     Id   = role.Id,
     Name = role.Name
 };
예제 #4
0
 public async Task DeleteAsync(BRole role)
 {
     await DeleteAsync(role.Id);
 }