public SqlServerEntityCollector(SqlServerAttribute attribute) { _attribute = attribute; _sqlConnectionBuilder = new SqlConnectionStringBuilder { DataSource = attribute.DatabaseServer, UserID = attribute.User, Password = attribute.Password, InitialCatalog = attribute.Database }; }
private Task <IValueBinder> BindForTypeOfEntity(SqlServerAttribute attribute, Type entityType) { var builder = new SqlConnectionStringBuilder { DataSource = attribute.DatabaseServer, UserID = attribute.User, Password = attribute.Password, InitialCatalog = attribute.Database }; var entityQuery = new EntityQuery { SchemaName = attribute.Schema, TableName = attribute.Table, EntityId = attribute.EntityId }; var entity = typeof(SqlServerEntity <>).MakeGenericType(entityType); var entityBinding = (IValueBinder)Activator.CreateInstance(entity, builder.ConnectionString, entityQuery); return(Task.FromResult(entityBinding)); }
public IAsyncCollector <T> Convert(SqlServerAttribute attribute) { return(new SqlServerEntityCollector <T>(attribute)); }