public override List <EntityState> GetAll(Type entityType) { OracleConnection connection = GetConnection(); try { connection.Open(); IEntityBroker broker = GetBroker(entityType); List <Entity> entities = broker.GetAll(connection); foreach (var entity in entities) { eStates.Add(new EntityState(entity, State.UNCHANGED)); } return(eStates); } catch (Exception) { throw; } finally { connection.Close(); } }
public override Entity Get(long id, Type entityType) { foreach (var es in eStates) { if (es.Entity.ID == id) { return(es.Entity); } } OracleConnection connection = GetConnection(); try { connection.Open(); IEntityBroker broker = GetBroker(entityType); Entity entity = broker.Get(id, connection); eStates.Add(new EntityState(entity, State.UNCHANGED)); return(entity); } finally { connection?.Close(); } }
private void InsertImpl(IEnumerable <Entity> entities, OracleConnection connection, OracleTransaction transaction) { foreach (var entity in entities) { IEntityBroker broker = GetBroker(entity.GetType()); broker.Insert(entity, connection, transaction); } }
private void UpdateOne(Entity entity, OracleConnection connection, OracleTransaction transaction) { IEntityBroker broker = GetBroker(entity.GetType()); broker.Update(entity, connection, transaction); }