示例#1
0
        public OperationResult Put(SurveyResource resource)
        {
            var s = repository.GetSurvey(resource.Id);
            s.Name = resource.Name;
            s.Title = resource.Title;
            s.Description = resource.Description;
            repository.Update(s);

            return new OperationResult.SeeOther { RedirectLocation = resource.CreateUri() };
        }
示例#2
0
 public OperationResult.SeeOther Post(NewSurveyResource resource)
 {
     var s = repository.Create(resource.Name, resource.Title, resource.Description);
     var r = new SurveyResource { Id = s.Id, Name = s.Name, Title = s.Title, Description = s.Description };
     return new OperationResult.SeeOther { RedirectLocation = r.CreateUri() };
 }