VEU.WathBody/3-app/1-lib/Kit.Helpers/SqlHelperAbstract/RequestParams.cs

50 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
namespace Kit.Helpers.SqlHelperAbstract
{
public class RequestParams
{
public IConnectionString ConnectionString { get; }
public string CommandText { get; }
public bool IsStoredProcedure { get; }
public bool WithStrictSyntax { get; }
public IEnumerable<KeyValuePair<string, object>> Parameters { get; }
public IEnumerable<CustomType> CustomTypes { get; }
public RequestParams(
IConnectionString connectionString,
string sqlText,
bool isStoredProcedure,
bool withStrictSyntax,
IEnumerable<KeyValuePair<string, object>> parameters,
IEnumerable<CustomType> customTypes
)
{
ConnectionString = connectionString;
CommandText = sqlText;
IsStoredProcedure = isStoredProcedure;
WithStrictSyntax = withStrictSyntax;
Parameters = parameters;
CustomTypes = customTypes;
}
}
public class RequestParamsSelect<TEntity> : RequestParams
{
public RequestParamsSelect(
IConnectionString connectionString,
string sqlText,
bool isStoredProcedure,
bool withStrictSyntax,
IEnumerable<KeyValuePair<string, object>> parameters,
IEnumerable<CustomType> customTypes,
params Action<IDataRecordSpecified, IList<TEntity>>[] converters
) : base(connectionString, sqlText, isStoredProcedure, withStrictSyntax, parameters, customTypes)
{
Converters = converters;
}
public IEnumerable<Action<IDataRecordSpecified, IList<TEntity>>> Converters { get; }
}
}