public void CreateRole(AggregateRole aggregateRole) { var role = aggregateRole.Role; role.RolePermissions = aggregateRole.Permissions; _roleRepository.Insert(role); }
public void UpdateRole(AggregateRole aggregateRole) { _roleRepository.Update(aggregateRole.Role); _rolePermissionRepository.Delete(x => x.RoleId == aggregateRole.Role.Id); _rolePermissionRepository.InsertRange(aggregateRole.Permissions); }