コード例 #1
0
        public async Task <IActionResult> DeleteAsync(int id)
        {
            var result = await
                         _manager
                         .DeleteAsync(id);

            return(Ok(result
                ? ServiceResponseHelper.GetSuccessResponse(result)
                : ServiceResponseHelper.GetFailureResponse <bool>()));
        }
コード例 #2
0
        public async Task <IActionResult> UpdateAsync(DepartmentUpdateModel department)
        {
            var result = await
                         _manager
                         .UpdateAsync(department);

            return(Ok(result
                ? ServiceResponseHelper.GetSuccessResponse(result)
                : ServiceResponseHelper.GetFailureResponse <bool>()));
        }
コード例 #3
0
 public async Task <IActionResult> AddAsync(DepartmentAddModel department)
 {
     return(Ok(
                ServiceResponseHelper
                .GetSuccessResponse(
                    await
                    _manager
                    .AddAsync(department)
                    )
                ));
 }
コード例 #4
0
 public async Task <IActionResult> GetAsync(int id)
 {
     return(Ok(
                ServiceResponseHelper
                .GetSuccessResponse(
                    await
                    _manager
                    .GetAsync(id)
                    )
                ));
 }