Esempio n. 1
0
        // POST: odata/CloudBreadErrorLogs
        public IHttpActionResult Post(CloudBreadErrorLog cloudBreadErrorLog)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.CloudBreadErrorLog.Add(cloudBreadErrorLog);
            db.SaveChanges();

            return(Created(cloudBreadErrorLog));
        }
Esempio n. 2
0
        // DELETE: odata/CloudBreadErrorLogs(5)
        public IHttpActionResult Delete([FromODataUri] int key)
        {
            CloudBreadErrorLog cloudBreadErrorLog = db.CloudBreadErrorLog.Find(key);

            if (cloudBreadErrorLog == null)
            {
                return(NotFound());
            }

            db.CloudBreadErrorLog.Remove(cloudBreadErrorLog);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
        // PUT: odata/CloudBreadErrorLogs(5)
        public IHttpActionResult Put([FromODataUri] int key, Delta <CloudBreadErrorLog> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            CloudBreadErrorLog cloudBreadErrorLog = db.CloudBreadErrorLog.Find(key);

            if (cloudBreadErrorLog == null)
            {
                return(NotFound());
            }

            patch.Put(cloudBreadErrorLog);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CloudBreadErrorLogExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(cloudBreadErrorLog));
        }