Пример #1
0
        public ServiceResponse <List <MailEntity> > ListUnreadMails(int toUserId)
        {
            var serviceResponseBuilder = new ServiceResponseBuilder <List <MailEntity> >();
            var obj = _repository.ListUnreadMails(toUserId);

            if (obj == null)
            {
                return(serviceResponseBuilder.NotOk(new ServiceError()
                {
                    Code = "200002", Message = "Unread mails can not list.", InnerMessage = "Unread mails can not list."
                }));
            }
            return(serviceResponseBuilder.Ok(obj));
        }