Ejemplo n.º 1
0
 public void UpdateTenant(Tenant toUpdate)
 {
     using (var ctx = new Landlord.Data.ApplicationDbContext())
     {
         ctx.Entry(toUpdate).State = EntityState.Modified;
         ctx.SaveChanges();
     }
 }
Ejemplo n.º 2
0
        public void UpdateProperty(Property toUpdate)
        {
            Result LocationData = GetLocationData(toUpdate.Address);

            using (var ctx = new Landlord.Data.ApplicationDbContext())
            {
                toUpdate.Latitude         = LocationData.geometry.location.lat.ToString();
                toUpdate.Longitude        = LocationData.geometry.location.lng.ToString();
                ctx.Entry(toUpdate).State = EntityState.Modified;
                ctx.SaveChanges();
            }
        }