Calculated Fields and SearchControl with dqm query

Feb 4, 2010 at 11:53 AM

Dear All,

We have an entity with a calculated field which is filled in PostRetrieving method of the entity.

In a search control for this entity we want to retrieve it while executing a qeury, however we get the error:

Error in async call:

FaultException: The field string <COLUMNNAME> is not included.

 

Are we missing something here or is this a bug in the framework.

TIA,

 

Marcel Numeijer

Coordinator
Feb 4, 2010 at 6:11 PM
Edited Feb 4, 2010 at 6:12 PM

Hi Marcel

Calculated columns does not exist on the database, there's no way the LINQ provider reads your PostRetriever and knows what is your definition of the field (because its compiled IL, not an expression tree). The same is applicable if you have an Ignored field.

In SF 1.0 that's it, you will have to write your query circunventing this limitation, or materialize your field using PreSaving.

On SF 2.0 though we expanded our Linq providers in 3 different cool ways. One of this could be usefull in your current situation:

static Expression<Func<ArtistDN, bool>> IsMaleExpression = a => a.Sex == Sex.Male;
public bool IsMale
{
    get { return Sex == Sex.Male; }
}

 By declaring a [MyProperty]Expression static field, the linq provider will understand this convention and replace "a.IsMale" by "a.Sex == Sex.Male" in your SQL

This part of the documentation is allready written http://www.signumframework.com/ExpressionTrees-Extensibility.ashx

Unfortunatelly, you will have to wait for SF 2.0 for this.

Cheers!

Feb 5, 2010 at 8:05 AM

Hi Olmo

>>> Unfortunatelly, you will have to wait for SF 2.0 for this.

When will SF 2.0 be available for download ? Can we use this framework in VS2008 with .Net 3.5 or are we obliged to use VS2010 and .Net 4.0 ?

Marcel Numeijer

 

 

 

Coordinator
Feb 5, 2010 at 1:49 PM

Hopefully, in about a Month. It's almost finished and we are documenting it. (just some bug fixes and general polishment)

I'm updating the documentation using this change log, you can use it as a progress bar for 2.0 to be released :)

http://www.signumframework.com/ChangeLog2.0.ashx

SF 2.0 targets VS 2008 and .Net 3.5, but we have allready changed some things to make the movement to .Net 4.0 easier.

Possibily the future SF 3.0 will target .Net 4.0

Olmo