public async Task <IHttpActionResult> PostSumAreaView(SumAreaView sumAreaView)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SumAreaViews.Add(sumAreaView);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (SumAreaViewExists(sumAreaView.Date))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = sumAreaView.Date }, sumAreaView));
        }
        public async Task <IHttpActionResult> PutSumAreaView(DateTime id, SumAreaView sumAreaView)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != sumAreaView.Date)
            {
                return(BadRequest());
            }

            db.Entry(sumAreaView).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SumAreaViewExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetSumAreaView(DateTime id)
        {
            SumAreaView sumAreaView = await db.SumAreaViews.FindAsync(id);

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

            return(Ok(sumAreaView));
        }
        public async Task <IHttpActionResult> DeleteSumAreaView(DateTime id)
        {
            SumAreaView sumAreaView = await db.SumAreaViews.FindAsync(id);

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

            db.SumAreaViews.Remove(sumAreaView);
            await db.SaveChangesAsync();

            return(Ok(sumAreaView));
        }