// POST: odata/TB_DATADIRECTORY
        public IHttpActionResult Post(TB_DATADIRECTORY TB_DATADIRECTORY)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.TB_DATADIRECTORY.Add(TB_DATADIRECTORY);
            db.SaveChanges();

            return(Created(TB_DATADIRECTORY));
        }
        // DELETE: odata/TB_DATADIRECTORY(5)
        public IHttpActionResult Delete([FromODataUri] decimal key)
        {
            TB_DATADIRECTORY TB_DATADIRECTORY = db.TB_DATADIRECTORY.Find(key);

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

            db.TB_DATADIRECTORY.Remove(TB_DATADIRECTORY);
            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult Patch([FromODataUri] decimal key, Delta <TB_DATADIRECTORY> patch)
        {
            Validate(patch.GetEntity());

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

            TB_DATADIRECTORY TB_DATADIRECTORY = db.TB_DATADIRECTORY.Find(key);

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

            patch.Patch(TB_DATADIRECTORY);

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

            return(Updated(TB_DATADIRECTORY));
        }