public static int UpdateRealEstateT_Location(RealEstateT res) { var count = 0; using (var ctx = new FRESContext()) { var org = ctx.RealEstateT.Find(res.RealEstateTId); if (org != null) { ctx.Entry(org).CurrentValues.SetValues(res); count = ctx.SaveChanges(); } } return count; }
public static int UpdateRealEstateE(RealEstateE res) { var count = 0; using (var ctx = new FRESContext()) { ctx.RealEstateE.Attach(res); var entry = ctx.Entry(res); entry.Property(e => e.Data).IsModified = true; entry.Property(e => e.State).IsModified = true; ctx.SaveChanges(); } return count; }