public async Task <ResponseViewModel> CreateAdmin(AdminInputModel model) { var department = _utilityRepository.DepartmentBy(model.DepartmentId); if (department == null) { return(Failed(ResponseMessageViewModel.INVALID_DEPARTMENT, ResponseErrorCodeStatus.INVALID_DEPARTMENT)); } model.IsAdmin = true; var result = await RegisterAsync(model); return(result); }
public Department DepartmentBy(int id) { return(_utilityRepository.DepartmentBy(id)); }