Exemplo n.º 1
0
        public IActionResult Post([FromBody] Models.DbSinDarEla.Mitteilungen item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

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

                this.OnMitteilungenCreated(item);
                this.context.Mitteilungens.Add(item);
                this.context.SaveChanges();

                var key = item.MitteilungID;

                var itemToReturn = this.context.Mitteilungens.Where(i => i.MitteilungID == key);

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

                return(new ObjectResult(SingleResult.Create(itemToReturn))
                {
                    StatusCode = 201
                });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Exemplo n.º 2
0
 partial void OnMitteilungenUpdated(Models.DbSinDarEla.Mitteilungen item);