Пример #1
0
        public DbQueryProvider(IDataProvider provider)
        {
            _provider = provider;

            QueryLanguage lang;

            switch (_provider.Client)
            {
            case DataClient.MySqlClient:
                lang = new MySqlLanguage(_provider);
                break;

            case  DataClient.SQLite:
                lang = new SqliteLanguage(_provider);
                break;

            default:
                lang = new TSqlLanguage(_provider);
                break;
            }

            //connection = _provider.CreateConnection();
            policy = new QueryPolicy(new ImplicitMapping(lang));

            mapping  = policy.Mapping;
            language = mapping.Language;
        }
Пример #2
0
 /// <summary>
 /// DbQueryProvider constrcutor that allows for external control of policy
 /// to allow for new types of databases.
 /// </summary>
 public DbQueryProvider(IDataProvider provider, QueryPolicy paramPolicy, TextWriter log)
 {
     _provider  = provider;
     connection = _provider.CreateConnection();
     policy     = paramPolicy;
     mapping    = policy.Mapping;
     language   = mapping.Language;
     //log = log;
 }
Пример #3
0
        public DbQueryProvider(IDataProvider provider)
        {
            _provider = provider;

            IQueryLanguage lang = provider.QueryLanguage;

            policy = new QueryPolicy(new ImplicitMapping(lang));

            mapping  = policy.Mapping;
            language = mapping.Language;
        }
Пример #4
0
 public static Expression Build(QueryPolicy policy, Expression expression, Expression provider)
 {
     return(new ExecutionBuilder(policy, provider).Build(expression));
 }
Пример #5
0
 private ExecutionBuilder(QueryPolicy policy, Expression provider)
 {
     this.policy   = policy;
     this.provider = provider;
 }
 public static Expression Include(QueryPolicy policy, Expression expression)
 {
     return new RelationshipIncluder(policy).Visit(expression);
 }
 private RelationshipIncluder(QueryPolicy policy)
 {
     this.policy = policy;
     this.mapping = policy.Mapping;
 }