Skip to content

Unable to cast object of type 'System.Linq.Expressions.UnaryExpression' to type 'IQToolkit.Data.Common.ColumnExpression'. #1

@toSilence

Description

@toSilence

Hi,

i get an error during using IQToolkit.
I have a Datacontext with two items Offer and OfferItems.

Both are connected together:
Offer has OfferItems
OfferItem has Offer

Context:

public partial class Offer {
public IList OfferItems { get; set; }
}

public partial class OfferItem {
public Offer Offer1 { get; set; }
}

Pseudo code:

policy.IncludeWith(o => o.OfferItems);
policy.IncludeWith(o => o.Offer1);

var q1 =
from l in db.OfferItems
select l;
=> working

var q2 =
from l in db.Offers
select l;
=> failed

I tried to change the policy to policy.IncludeWith(o => o.OfferItems, true); but got another exception.
If I change the context IList to OfferItem the linq query is working but not correct.

Any help appreciate.

Thx in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions