public bool UpdateCompanyLocation(CompanyLocationEdit model)
 {
     using (var ctx = new ApplicationDbContext())
     {
         var entity =
             ctx
             .CompanyLocations
             .Single(e => e.CompanyID == model.CompanyID);
         entity.Street = model.Street;
         entity.City   = model.City;
         entity.State  = model.State;
         entity.Zip    = model.Zip;
         return(ctx.SaveChanges() == 1);
     }
 }
        public IHttpActionResult Put(CompanyLocationEdit company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var service = CreateCompanyLocationService();

            if (!service.UpdateCompanyLocation(company))
            {
                return(InternalServerError());
            }

            return(Ok());
        }