示例#1
0
        internal static List <T> Execute(string tableName, IEntityMapping <T> entityMapping)
        {
            StringBuilder query = new StringBuilder();

            query.Append($"SELECT * FROM {tableName}");

            return(SqlCommandExecuteQueryForSelect <T> .Execute(query.ToString(), entityMapping));
        }
示例#2
0
        internal static List <T> Execute(
            string tableName,
            IEntityMapping <T> entityMapping,
            Dictionary <string, string> columnValueFilter)
        {
            StringBuilder query = new StringBuilder();

            query.Append($"SELECT * FROM {tableName} WHERE ");

            foreach (var columnFilter in columnValueFilter)
            {
                query.Append($"{columnFilter.Key} = {columnFilter.Value} AND ");
            }

            query.Remove(query.Length - 4, query.Length);

            return(SqlCommandExecuteQueryForSelect <T> .Execute(query.ToString(), entityMapping));
        }