Esempio n. 1
0
        public async Task CreateAsync(BRole role)
        {
            var dRole = role.ToDbRole();

            await InsertAsync(dRole);

            role.Id = dRole.Id;
        }
Esempio n. 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");
            }
        }
Esempio n. 3
0
 public static DRole ToDbRole(this BRole role) => new DRole
 {
     Id   = role.Id,
     Name = role.Name
 };
Esempio n. 4
0
 public async Task DeleteAsync(BRole role)
 {
     await DeleteAsync(role.Id);
 }