예제 #1
0
 public static void Refresh <T>(this ApplicationEntitie db) where T : class
 {
     foreach (var entity in db.Set <T>())
     {
         db.Entry(entity).State = EntityState.Detached;
     }
     db.Set <T>().Load();
 }
예제 #2
0
 public static bool Any <T>(this ApplicationEntitie db, Func <T, bool> predicate) where T : class
 {
     return(db.Set <T>()
            .Any(predicate) || db.Set <T>()
            .Local.Any(predicate));
 }
예제 #3
0
 public static IEnumerable <T> WhereLocal <T>(this ApplicationEntitie db, Func <T, bool> predicate) where T : class
 {
     return(db.Set <T>().Local.Where(predicate));
 }
예제 #4
0
 public static T[] ToArray <T>(this ApplicationEntitie db) where T : class
 {
     return(db.Set <T>().ToArray());
 }
예제 #5
0
 public static IList <T> ToList <T>(this ApplicationEntitie db) where T : class
 {
     return(db.Set <T>().ToList());
 }