Exemple #1
0
        public async Task <IActionResult> Put([FromBody] Department department)
        {
            if (department == null)
            {
                return(BadRequest());
            }

            await DepartmentRepository.UpdateAsync(DepartmentConverter.Convert(department));

            return(new OkObjectResult(department));
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 ///<inheritdoc/>
 public async Task <Department> GetDepartment(Guid id)
 {
     return(DepartmentConverter.Convert(await _websiteDbContext.Departments.FindAsync(id)));
 }