public static bool Commit() { try { EntityDb <T> .CommitChanges(); EntityDb <T> .CloseSession(); return(true); } catch (Exception) { throw; } }
public static List <T> GetEntities(Func <T, bool> query) { try { List <T> results = new List <T>(); results = EntityDb <T> .GetByLinqQuery(query); EntityDb <T> .CloseSession(); return(results); } catch (Exception) { throw; } }
public static List <T> PagedGetAllEntities(int start, int pageSize, out int totalCount) { try { List <T> results = new List <T>(); results = EntityDb <T> .PagedGetAll(start, pageSize, out totalCount); EntityDb <T> .CloseSession(); return(results); } catch (Exception) { throw; } }
public static List <T> GetAllEntities() { try { List <T> results = new List <T>(); results = EntityDb <T> .GetAll(); EntityDb <T> .CloseSession(); return(results); } catch (Exception) { throw; } }
public static List <T> PagedGetEntities(System.Linq.Expressions.Expression <Func <T, bool> > query, int start, int pageSize, out int totalCount) { try { List <T> results = new List <T>(); results = EntityDb <T> .PagedGetByLinqQuery(query, start, pageSize, out totalCount); EntityDb <T> .CloseSession(); return(results); } catch (Exception) { throw; } }
public static bool EditEntity(T entity) { try { EntityDb <T> .SaveOrUpdate(entity); EntityDb <T> .CommitChanges(); EntityDb <T> .CloseSession(); return(true); } catch (Exception) { throw; } }