public void CreateEntityStorageMechanism(object Entity)
        {
            var Statement = DMLStatementFactory.GetDDLStatementGenericEntityStorageCreation(_tenant, Entity);

            ((IExecuteDML)_dbaccess).Execute(Statement);

            //this.sqlStatementExecuted(Statement.PreparedStatement);

            SqlStatementExecuted?.Invoke(Statement.PreparedStatement, Statement.Variables);
        }
        public void CreateEntity(object Entity)
        {
            var Statement = DMLStatementFactory.GetDMLStatementForGenericEntity(_tenant, Entity, DMLStatemtType.Insert, null);

            ((IExecuteDML)_dbaccess).Execute(Statement);

            //this.sqlStatementExecuted(Statement.PreparedStatement);


            SqlStatementExecuted?.Invoke(Statement.PreparedStatement, Statement.Variables);
        }
        public long UpdateEntity(object Entity)
        {
            EntityDescriber ed = new EntityDescriber(Entity);

            if (ed.UniqueKeyProvidedOnEntity() == false && ed.PrimaryKeyProvidedOnEntity() == false)
            {
                throw new Exception("Neither a Primary Key nor UniqueKey was provided for the object.");
            }

            var Statement = DMLStatementFactory.GetDMLStatementForGenericEntity(_tenant, Entity, DMLStatemtType.Update, null);
            var ret       = (Int32)((IExecuteDML)_dbaccess).Execute(Statement);

            SqlStatementExecuted?.Invoke(Statement.PreparedStatement, Statement.Variables);
            return(ret);
        }
Exemple #4
0
 private void _barDatabaseAccess_sqlStatementExecuted1(string Sql, List <ISQLDMLStatementVariable> Variables)
 {
     SqlStatementExecuted?.Invoke(Sql, Variables);
 }