Пример #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());
 }