Beispiel #1
0
        public IActionResult Post([FromBody] Models.DbSinDarEla.Feedback item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (item == null)
                {
                    return(BadRequest());
                }

                this.OnFeedbackCreated(item);
                this.context.Feedbacks.Add(item);
                this.context.SaveChanges();

                var key = item.FeedbackID;

                var itemToReturn = this.context.Feedbacks.Where(i => i.FeedbackID == key);

                Request.QueryString = Request.QueryString.Add("$expand", "Base");

                return(new ObjectResult(SingleResult.Create(itemToReturn))
                {
                    StatusCode = 201
                });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Beispiel #2
0
 partial void OnFeedbackUpdated(Models.DbSinDarEla.Feedback item);