Dynamic LINQ to Entity Count() -


I am trying to write the following shortline code more generally.

Do I want to achieve it, this is a simple number of records that have been changed or made since a certain date.

  Public Ink Gate-Change (Datetime Free Accountivity Debt) {KHS Innopus. Web. Library. Data Model Documentation Documentation CTX = New KHS Innopus Web. Library. Data will be available. Documentation. Documentation (); Return ctx.Images.Count (line = & gt; line.selected & gt; final activity); }  

I want to convert the sample above to more generic functions such as

  Public Ink Gatechange (Metatable Table, String Columnname, Datetime, Last Activity Datum) Are {return table. Count (line = & gt; line. columnName & gt; final activity); }  

So far what I have tried

  public int GetChanges (MetaTable table, string columnName, DateTime lastActivityDate) {// query = {table (LanguageText)}} var query = table.GetQuery (); Metacallum date column; Table Triget column (column name, out date column); If (dateColumn == faucet) new string back [] {}; Var existenceParam = expression. Parameter (Table Antitie Type, "Row"); Var property = expression. Property (Entityparam, Datakolam. Name); Var column lambda = expression. Lambda (property, unit husband); Var constant = expression. Constant (last activity); Were Greater Tactical = Expression. Greatर्थ (pillar lambda body, continuous); Var where lambda = expression Lambda (GreaterTancaul, Unit Parm); Var where call = expression.col (typef (query), "count", new type [] {query.ElementType}, query .expression, where lambda); Var result = query.Provider.CreateQuery (where call); Return result; }  

The problem is now, where 'the call' is wrong and throws a (German) error, any idea, how is it to look?

Thank you for your help Sebastian

Further information: This German error is:

Abfrageausdrücke für 'LINQ for entities' können nur aus Instant Configuration Manager, die die IQueryable-Schnittstelle implementieren Parameter Name: Expression

You are able to turn it off using the dynamic linq query library May be. This allows you to pass the volume in the form of stars. Example:

More information can be found on


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -