dynamicquery

Enhanced DynamicQuery?

I've recently started using the DynamicQuery API, and it quickly became apparent that it has numerous limitations. I've found at least one improvement online: support for enum arguments, but it's pretty clear that this API is not actively maintained (if at all). In case I'm wrong and there is somebody maintaining an improved version - p...

Dynamic query with HibernateCritera API & Oracle - performance

I have to use Hibernate and retrieve data from Oracle but the problem is, that the number of parameters passed to the query is not always the same. For the sake of simplicity let's consider the following query: select COL_1, COL_2, ..., COL_N from TAB_1 where COL_1 in (?, ?, ... ?) The number of parameters passed to in clause is betwe...

displaying one-to-many results from dynamic query

I'm using the dynamic query library and I'm trying to retrieve and access a single record from a one to many 'included' table/entity. I have the following code: var xresults = viv.tbl_user .Include("tbl_pics") .Include("tbl_user_bio") .Include("tbl_province") .Include("tbl_area"...

C#, Linq, Dynamic Query: Code to filter a Dynamic query outside of the Repository

If you do something like this in your Repository: IQueryable<CarClass> GetCars(string condition, params object[] values) { return db.Cars.Where(condition, values); } And you set the condition and values outside of the repository: string condition = "CarMake == @Make"; object[] values = new string[] { Make = "Ford" }; var result ...

How can I extend DynamicQuery.cs to implement a .Single method?

I need to write some dynamic queries for a project I'm working on. I'm finding out that a significant amount of time is being spent by my program on the Count and First methods, so I started to change to .Single, only to find out that there is no such method. The code below was my first attempt at creating one (mostly copied from the W...

How to write this Linq SQL as a Dynamic Query (using strings)?

Skip to the "specific question" as needed. Some background: The scenario: I have a set of products with a "drill down" filter (Query Object) populated with DDLs. Each progressive DDL selection will further limit the product list as well as what options are left for the DDLs. For example, selecting a hammer out of tools limits the Pr...

How to get LinqPad to work with "Dynamic Query"?

Dynamic Query is a single C# file you add to your project. Anyone know how to add this library so that it works with LinqPad? ...

How to cast a Linq Dynamic Query result as a custom class?

Normally, I do this: var a = from p in db.Products where p.ProductType == "Tee Shirt" group p by p.ProductColor into g select new Category { PropertyType = g.Key, Count = g.Count() } But I have code like this: var a = Products .Where("ProductType == @0", "Tee Shirt") ...

Simple Linq Dynamic Query question

In Linq Dynamic Query, Scott Guthrie shows an example Linq query: var query = db.Customers. Where("City == @0 and Orders.Count >= @1", "London", 10). OrderBy("CompanyName"). Select("new( CompanyName as Name, Phone)"); Notice the projection new( CompanyName as Name, Phone). If I have a class like this: public class Co...

Dynamic Linq Library Guid exceptions

I am having a problem with the Dynamic Linq Library. I get a the following error "ParserException was unhandled by user code ')" or ','". I have a Dicitionary and I want to create a query based on this dictionary. So I loop through my dictionary and append to a string builder "PersonId = (GUID FROM DICTIONARY). I think the problem is wer...

Problem with Namespaces? Trouble When Using DynamicQuery Sample

DynamicQuery is a sample project that allows 'Dynamic' LINQ strings to be executed at run-time. I want to use this in a project of mine. I've created a new Window Forms Application in VB.Net; and add the existing item - 'Dynamic.vb' (taken from the DynamicQuery example). Once I do that, code that was previous fine, is now marked as in...

To call SelectMany dynamically in the way of System.Linq.Dynamic

In System.Linq.Dynamic, there are a few methods to form Select, Where and other Linq statements dynamically. But there is no for SelectMany. The method for Select is as the following: public static IQueryable Select(this IQueryable source, string selector, params object[] values) { if (source == null) throw new Argument...

Dymanic Query in Ibatis

Hello All, Is it possible to pass dynamic query to Ibatis and get the record from it? E.g. I built my query using StringBuilder and at last, I got the following query "select emp_id, emp_name from employee where emp_id==1" . Now i need to pass this complete query to Ibatis and get the record. Note: Here the number of columns and wher...

Complex Linq.Dynamic queries

I am trying to figure out how to create some dynamic queries. I have looked at Linq.Dyanmic and it is missing some things that I think I may need. My goal is to essential flatten the relational database, this is for creating searches on the fly by the user, into one object with properties from many different tables/entities. Example: ...

Using First() with OrderBy and DynamicQuery in One-To-Many related tables

Note: I realize this question is similar to another question, however that question was asked in the context of Genom-e and remains unanswered. My question is in the context of LINQ DynamicQuery. I'm using the String extension method overload for OrderBy provided by System.Linq.Dynamic. Passing a String Literal to OrderBy works g...