Exemplo n.º 1
0
        public int CompareTo(object obj)
        {
            MessagesViewModel message = obj as MessagesViewModel;

            if (message != null)
            {
                return(this.CreatedDate.CompareTo(message.CreatedDate));
            }
            else
            {
                throw new Exception("Невозможно сравнить два объекта");
            }
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            var messages = App.Messages;

            if (Request.IsAjaxRequest())
            {
                return Json(messages, JsonRequestBehavior.AllowGet);
            }

            var viewModel = new MessagesViewModel(messages);

            return View(viewModel);
        }