示例#1
0
        public HttpResponseMessage Get(long id)
        {
            var mail = _mailRepository.GetById(id);

            if (mail == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, mail));
        }
示例#2
0
 public async Task <Mail> GetMail(long id,
                                  [Service] IMailRepository mailRepository)
 {
     return(await mailRepository.GetById(id));
 }
 public Mail GetMailById(int id)
 {
     return(_mailRepository.GetById(id));
 }