public IHttpActionResult PutSalesTerritory(int id, SalesTerritory salesTerritory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != salesTerritory.TerritoryID)
            {
                return BadRequest();
            }

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

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

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PostSalesTerritory(SalesTerritory salesTerritory)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.SalesTerritories.Add(salesTerritory);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = salesTerritory.TerritoryID }, salesTerritory);
        }