public async Task <IActionResult> Put([FromBody] Department department) { if (department == null) { return(BadRequest()); } await DepartmentRepository.UpdateAsync(DepartmentConverter.Convert(department)); return(new OkObjectResult(department)); }
public List <DepartmentModel> GetDepartmentById(int Id) { List <DepartmentModel> result = new List <DepartmentModel>(); var dataResult = _departmentRepository.GetDepartmentById(Id); if (dataResult != null && dataResult.Count() > 0) { result = DepartmentConverter.Convert(dataResult); } return(result); }
///<inheritdoc/> public async Task <Department> GetDepartment(Guid id) { return(DepartmentConverter.Convert(await _websiteDbContext.Departments.FindAsync(id))); }