コード例 #1
0
ファイル: SurveyHandler.cs プロジェクト: oharab/OpenSurvey
        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
ファイル: NewSurveyHandler.cs プロジェクト: oharab/OpenSurvey
 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() };
 }