Esempio n. 1
0
        internal static MySqlCommand MockDelete <TSource, TTarget>(this DbTable <TTarget> dbTable, bool success, DataSet <TSource> source, int ordinal, Func <TSource, TTarget, KeyMapping> keyMapper)
            where TSource : Model, new()
            where TTarget : Model, new()
        {
            var keyMapping = dbTable.Verify(keyMapper, nameof(keyMapper), source._);

            dbTable.UpdateOrigin <TSource>(source, success);
            var statement = dbTable.BuildDeleteScalarStatement(source, ordinal, keyMapping.GetColumnMappings());

            return(dbTable.MySqlSession().GetDeleteCommand(statement));
        }