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(); }
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)); }
public static IEnumerable <T> WhereLocal <T>(this ApplicationEntitie db, Func <T, bool> predicate) where T : class { return(db.Set <T>().Local.Where(predicate)); }
public static T[] ToArray <T>(this ApplicationEntitie db) where T : class { return(db.Set <T>().ToArray()); }
public static IList <T> ToList <T>(this ApplicationEntitie db) where T : class { return(db.Set <T>().ToList()); }