示例#1
0
        public ActionResult TercumanMailRead(int id)
        {
            BusinessLayerResult <Mesaj> res =
                mailManager.GetMail(id);

            if (res.Errors.Count > 0)
            {
                ErrorViewModel errorNotifyObj = new ErrorViewModel()
                {
                    Title = "Hata Oluştu",
                    Items = res.Errors
                };

                return(View("Error", errorNotifyObj));
            }

            return(View(res.Result));
        }
示例#2
0
 async public Task <IActionResult> GetMail(DateTime since)
 {
     try
     {
         var user   = httpContext.User.Identity as ClaimsIdentity;
         var userId = user.Claims.First(x => x.Type == ClaimTypes.NameIdentifier).Value;
         var mgr    = new MailManager();
         return(Ok(await mgr.GetMail(userId, since)));
     }
     catch (Exception ex)
     {
         _logger.LogError($"GetChannelChats: {ex.Message}");
     }
     return(StatusCode(500, $"Error getting mail since {since}"));
 }