private IList <UserTable> RetrieveAllEntitiesFiltered(Func <UserTable, bool> funcOperation) { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { return(_dbContext.UserTables.Where(funcOperation).ToList()); } }
private IList <UserTable> RetrieveAllEntities() { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { // DatabaseOptionConfigRetriever.DatabaseOptionAppSetting return(_dbContext.UserTables.ToList()); } }
private UserTable FindEntityMatching(Func <UserTable, bool> funcOperation) { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { // DatabaseOptionConfigRetriever.DatabaseOptionAppSetting return(_dbContext.UserTables.SingleOrDefault(funcOperation)); } }
public bool?EntityExistMatchingUsernameAndPassword(string username, string password) { try { using (UserAbstractDbContext _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { return(_dbContext.UserTables.Any(u => u.UserName == username && u.Password == password)); } } catch (Exception exception) { // } return(null); }
public bool?EntityExistMatchingFunc(Func <UserTable, bool> funcOperation) { try { using (UserAbstractDbContext _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { return(_dbContext.UserTables.Any(funcOperation)); } } catch (Exception exception) { // } return(null); }
public bool?EntityExistMatchingId(long id) { try { using (UserAbstractDbContext _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { return(_dbContext.UserTables.Any(u => u.Id == id)); } } catch (Exception exception) { // } return(null); }
public void SaveChange() { CheckingInternalCollectionValidity(); try { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { _dbContext.UserTables.AddRange(_newUsers); _dbContext.SaveChanges(); _newUsers.Clear(); } } catch (Exception exception) { throw; } }
public void ExecuteDeletion() { CheckingInternalCollectionValidity(); try { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { _dbContext.UserTables.RemoveRange(_userToDelete); _dbContext.SaveChanges(); _userToDelete.Clear(); } } catch (Exception exception) { throw; } }
public void UpdateChange() { CheckingInternalCollectionValidity(); try { using (var _dbContext = UserDbFactory.GetUserDbContext(_dbContextType)) { MarkCollectionAsUpdate(_dbContext, _usersToUpdate); _dbContext.SaveChanges(); _usersToUpdate.Clear(); } } catch (Exception exception) { throw; } }