public async Task HandlerAsync(RoleCommand command) { try { var role = new Role(); role.AddRole(command.RoleName.RoleNameFa, command.RoleName.RoleNameEn); unitOfWork.RoleRepository.AddRole(role); unitOfWork.Commit(); } catch (Exception ex) { throw ex; } }
public async Task HandlerAsync(AccessLevelCommand command) { try { var role = new Role(); var access = role.SetAccessLevel(command.Controller, command.Action, command.RoleId); unitOfWork.RoleRepository.AddAccessLevel(access); unitOfWork.Commit(); } catch (Exception ex) { throw ex; } }