예제 #1
0
 public void Update(TenantModel modelTenant)
 {
     FirstName    = modelTenant.FirstName;
     LastName     = modelTenant.LastName;
     Telephone    = modelTenant.Telephone;
     EmailAddress = modelTenant.EmailAddress;
     Address.Update(modelTenant.Address);
 }
예제 #2
0
 public void Update(PropertyModel modelProperty)
 {
     AddressId         = modelProperty.AddressId;
     PropertyName      = modelProperty.PropertyName;
     SquareFeet        = modelProperty.SquareFeet;
     NumberOfBedrooms  = modelProperty.NumberOfBedrooms;
     NumberOfBathrooms = modelProperty.NumberOfBathrooms;
     NumberOfVehicle   = modelProperty.NumberOfVehicle;
     Address.Update(modelProperty.Address);
 }
        public IHttpActionResult PostAddress(AddressModel address)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            var newAddress = new Address();
            newAddress.Update(address);            

            db.Addresses.Add(newAddress);
            db.SaveChanges();

            address.AddressId = newAddress.AddressId;

            return CreatedAtRoute("DefaultApi", new { id = address.AddressId }, address);
        }