public override IEnumerable <T> RunQuery <T>(CHXQuery query) { var result = Database.Connection.RunQuery <T>(query); return(result); }
public override IEnumerable <T> RunQuery <T>(CHXQuery query) { var result = Connection.Query <T>(query.Sql, query.Parameter, query.Transaction, query.Buffered, query.CommandTimeout, query.CommandType); var pgconverter = PgDataConverterFactory.GetConverter(typeof(T).Name); if (pgconverter == null) { return(result); } else { return(pgconverter.Convert <T>(query, result)); } }
public override IEnumerable <T> RunQuery <T>(QueryContainer queryContainer) { if (queryContainer.Database.DatabaseType != this.Database.DatabaseType) { throw new Exception("Hedef veri tabanı tipi ve sorgu veri tabanı tipi uyumsuz."); } var query = new CHXQuery(); query.Sql = queryContainer.Sql; query.Parameter = queryContainer.Parameter; query.AddGeometry = queryContainer.AddGeometry; query.GeometryColumn = queryContainer.GeometryColumn; return(this.RunQuery <T>(query)); }
public override IEnumerable <T> Convert <T>(CHXQuery query, dynamic data) { var collection = new CHXFeatureCollection(); foreach (var row in data) { var feature = new CHXFeature(); feature.properties = new Dictionary <string, object>(); foreach (var col in (row as IDictionary <string, object>)) { if (col.Key == query.GeometryColumn) { if (query.AddGeometry) { var geom = new CHXGeometry(); geom.ReadWkt(col.Value.ToString()); feature.geometry = geom; } } else { feature.properties.Add(col); } } collection.features.Add(feature); } return(collection.features as IEnumerable <T>); }
public abstract IEnumerable <T> Convert <T>(CHXQuery query, dynamic data);