public async Task <MainScreenResponse> DeleteScreen(ScreenDeleteRequest screenDeleteRequest) { try { var isExistRecord = _screenRepository.Get <Screens>(screenDeleteRequest.ScreensId); var screen = _mapper.Map <Screens>(isExistRecord); if (screen.ScreensId != 0) { screen.DeletedOn = DateTime.Now; screen.DeletedBy = screenDeleteRequest.ActionBy.ToString(); screen.IsDeleted = true; var dataRole = await _screenRepository.UpdateAsync(screen); _response.Message = Constants.Screen_Deleted_Success; _response.Status = true; } else { _response.Message = Constants.Screen_Not_Delete; _response.Status = false; } } catch (Exception) { _response.Status = false; _response.Message = Constants.DEFAULT_ERROR_MSG; } return(_response); }
public async Task <IActionResult> Get(string id) { return(await FunctionWrapper.ExecuteFunction(this, async() => { return await _screenRepository.Get(new ObjectId(id)); })); }
public IEnumerable <Screen> Get(Pagination pagination) { return(_screenRepository.Get(pagination)); }