public List <SPGetNotificationCenter_Result> Filter(NotificationCenterQuery query, out int count) { count = 0; int pageNumber = query.PageNumber != 0 ? query.PageNumber : 1; var userId = query.UserId; var start = 0; var limit = query.PageSize; start = (pageNumber - 1) * limit; int totalRow = 0; List <SPGetNotificationCenter_Result> result = new List <SPGetNotificationCenter_Result>(); ObjectParameter prTotalRow = new ObjectParameter("total", totalRow); result = _entities.SPGetNotificationCenter(userId, query.DeviceId, start, limit, prTotalRow).ToList(); count = (prTotalRow.Value == null) ? 0 : Convert.ToInt32(prTotalRow.Value); return(result); }
public BaseListResponse <SPGetNotificationCenter_Result> GetNotificationCenter([FromUri] NotificationCenterQuery query) { return(shareService.GetNotifcationCenter(query)); }
public BaseListResponse <SPGetNotificationCenter_Result> GetNotifcationCenter(NotificationCenterQuery query) { var response = new BaseListResponse <SPGetNotificationCenter_Result>(); int count = 0; try { response.Data = _notificationCenterRepository.Filter(query, out count); response.TotalItems = count; response.PageNumber = query.PageNumber != 0 ? query.PageNumber : 1; response.PageSize = query.PageSize; } catch (Exception ex) { response.Message = "Error: " + ex.Message + " StackTrace: " + ex.StackTrace; } return(response); }