コード例 #1
0
        public ActionResult Post(ExampleRequestObject requestResource)
        {
            var model = new DomainObject(requestResource.SomeValue);

            _repository.AddDomainObject(model);

            _repository.SaveChanges();

            return(Ok());
        }
コード例 #2
0
ファイル: CqrsController.cs プロジェクト: Slacquer/api-blox
        public async Task <ActionResult> Post(ExampleRequestObject requestResource)
        {
            var ret = await _commandHandler.HandleAsync(requestResource, CancellationToken.None);

            if (ret.HasErrors)
            {
                return(new ProblemResult(ret.Error));
            }

            return(Ok());
        }
コード例 #3
0
        public ActionResult Post(ExampleRequestObject requestResource)
#endif
        {
            //
            //  SIDE NOTE:
            // we should be returning a route with id, but
            // I'm lazy and that's not the point of all this... :/

            return(Conflict(new
            {
                detail = "Please see errors property for more details",
                errors = new[]
                {
                    new
                    {
                        detail = "he userSettings does not exist for the supplied Id/Key.",
                        title = "The request method does not allow this functionality as upsert semantics are not supported."
                    }
                }
            }
                            ));

            //  return Ok(new {Id = 1, requestResource.CoolNewValue, requestResource.ValueId});
        }
コード例 #4
0
 public ActionResult Post(ExampleRequestObject requestResource)