示例#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;
 }
 public static Expression Rewrite(QueryLanguage language, Expression expression)
 {
     return new SingletonProjectionRewriter(language).Visit(expression);
 }
 private SingletonProjectionRewriter(QueryLanguage language)
 {
     this.language = language;
 }
 public ImplicitMapping(QueryLanguage language)
     : base(language)
 {
 }
 protected QueryMapping(QueryLanguage language)
 {
     this.language = language;
 }
示例#7
0
 protected QueryMapping(QueryLanguage language)
 {
     this.language = language;
 }
 public static Expression Rewrite(QueryLanguage language, Expression expression)
 {
     return new ClientJoinedProjectionRewriter(language).Visit(expression);
 }
 private ClientJoinedProjectionRewriter(QueryLanguage language)
 {
     this.language = language;
 }
示例#10
0
 public ImplicitMapping(QueryLanguage language)
     : base(language)
 {
 }