public object Post(Guid id,CommentViewModel entity, string action) { switch (action) { case "delete": return Delete(id); case "renew": return Renew(id); } throw new HttpResponseException(HttpStatusCode.NotFound); }
public CommentViewModel Put(CommentViewModel viewModel) { var entity = viewModel.ToEntity(); entity.Ip = HttpContext.Current.Request.UserHostAddress; entity.Address = IpLocator.GetIpLocation(entity.Ip); entity.IsAdmin = true; CommandFactory.Instance.Create(entity); WebGuestCookie.Save(entity.Author, entity.Email, entity.Url, true); return entity.ToViewModel(); }