public async Task <IHttpActionResult> PutPropertyVendor(int id, PropertyVendor propertyVendor)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != propertyVendor.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetPropertyVendor(int id)
        {
            PropertyVendor propertyVendor = await db.PropertyVendor.FindAsync(id);

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

            return(Ok(propertyVendor));
        }
        public async Task <IHttpActionResult> PostPropertyVendor(PropertyVendor propertyVendor)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.PropertyVendor.Add(propertyVendor);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = propertyVendor.ID }, propertyVendor));
        }
        public async Task <IHttpActionResult> DeletePropertyVendor(int id)
        {
            PropertyVendor propertyVendor = await db.PropertyVendor.FindAsync(id);

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

            db.PropertyVendor.Remove(propertyVendor);
            await db.SaveChangesAsync();

            return(Ok(propertyVendor));
        }