示例#1
0
文件: DataHelper.cs 项目: Rarve/FRES
 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;
 }
示例#2
0
文件: DataHelper.cs 项目: Rarve/FRES
 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;
 }