コード例 #1
0
ファイル: MessageController.cs プロジェクト: xianmingliu/CMS
        public BoardViewModel Put(BoardViewModel viewModel)
        {
            var entity = viewModel.ToBoardEntity();
            entity.Ip = HttpContext.Current.Request.UserHostAddress;
            entity.Address = IpLocator.GetIpLocation(entity.Ip);

            CommandFactory.Instance.Create(entity);

            return entity.ToBoardViewModel();
        }
コード例 #2
0
ファイル: MessageController.cs プロジェクト: nlsp60/CMS
        public BoardViewModel Put(BoardViewModel viewModel)
        {
            var entity = viewModel.ToEntity();
            entity.Ip = HttpContext.Current.Request.UserHostAddress;
            entity.Address = IpLocator.GetIpLocation(entity.Ip);

            Command.Instance.Create(entity);
            WebGuestCookie.Save(entity.Author);

            return entity.ToViewModel();
        }
コード例 #3
0
ファイル: MessageController.cs プロジェクト: nlsp60/CMS
 public object Post(Guid id, BoardViewModel entity, string action)
 {
     switch (action)
     {
         case "delete":
             return Delete(id);
         case "renew":
             return Renew(id);
     }
     throw new HttpResponseException(HttpStatusCode.NotFound);
 }