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(); }
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(); }
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); }