public async Task <Result> UpdatePictureTypeAsync(PictureTypeViewModel model) { var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model); var saveChange = await _iPictureTypeRepository.UpdatePictureTypeAsync(data); if (saveChange > 0) { return(Result.Ok(MessageHelper.Update)); } else { return(Result.Fail(MessageHelper.UpdateFail)); } }
public async Task <Result> InsertPictureTypeAsync(PictureTypeViewModel model) { try { var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model); var saveChange = await _iPictureTypeRepository.InsertPictureTypeAsync(data); if (saveChange > 0) { return(Result.Ok(MessageHelper.Save)); } else { return(Result.Fail(MessageHelper.SaveFail)); } } catch (Exception ex) { throw; } }
public async Task <int> InsertOrUpdatetPictureTypeAsync(PictureTypeViewModel model) { var data = _iMapper.Map <PictureTypeViewModel, PictureType>(model); return(await _iPictureTypeRepository.InsertOrUpdatetPictureTypeAsync(data)); }