Ejemplo n.º 1
0
        public static IEnumerable <dynamic> GetList(this IDbConnection connection,
                                                    SelectConfiguration selectConfiguration, object parameterValues)
        {
            var selectQuery = new QueryBuilder.SelectQueryBuilder.QueryBuilder().GetSelectQuery(selectConfiguration);

            return(connection.Query <dynamic>(selectQuery, parameterValues));
        }
Ejemplo n.º 2
0
        public static T FindById <T>(this IDbConnection connection, SelectConfiguration configuration,
                                     object id, Tenant tenant = null)
        {
            var selectQuery = new QueryBuilder.SelectQueryBuilder.QueryBuilder().GetSelectQuery(configuration);

            if (!selectQuery.ToUpper().Contains("WHERE"))
            {
                selectQuery = selectQuery + "Where Id=@Id";
            }
            return(FindById <T>(connection, selectQuery, id, tenant: tenant));
        }
Ejemplo n.º 3
0
        public static Result <SpTransactionMessage> UpdateExtentionTable <T>(this IDbConnection connection, IDictionary <string, object> parameterValues, IDbTransaction transaction = null)
        {
            if (parameterValues == null)
            {
                throw new ArgumentException("Invalid extention table values");
            }
            var updateConfiguration = GetUpdateConfiguration <T>(parameterValues);
            var updateQuery         = new QueryBuilder.SelectQueryBuilder.QueryBuilder().GetUpdateQuery(updateConfiguration);

            return(ExecuteQuery(connection, updateQuery, parameterValues, CommandType.Text, transaction));
        }
Ejemplo n.º 4
0
        public static dynamic FindById(this IDbConnection connection, SelectConfiguration selectConfiguration, object id)
        {
            var selectQuery = new QueryBuilder.SelectQueryBuilder.QueryBuilder().GetSelectQuery(selectConfiguration);

            return(FindById(connection, selectQuery, id));
        }