public ServiceResponse <List <MailEntity> > ListForUser(int page, int pageSize, int toUserId) { var serviceResponseBuilder = new ServiceResponseBuilder <List <MailEntity> >(); var obj = _repository.ListForUser(page, pageSize, toUserId); if (obj == null) { return(serviceResponseBuilder.NotOk(new ServiceError() { Code = "200001", Message = "Received mails can not list.", InnerMessage = "Received mails can not list." })); } return(serviceResponseBuilder.Ok(obj)); }