Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to query data with where clause including ValueObject,please? #238

Open
effapp opened this issue Feb 23, 2022 · 2 comments
Open

How to query data with where clause including ValueObject,please? #238

effapp opened this issue Feb 23, 2022 · 2 comments

Comments

@effapp
Copy link

effapp commented Feb 23, 2022

How to query data with where clause including ValueObject,please?

like this:
dbContext.Set().Where(o=>o.TotalAmount.Value >50000).ToList();

but it throw exception.

TotalAmount is the ValueObject of { Value, Currency}.

@effapp effapp changed the title Custom Domain Entity throw Exception,why?please. How to query data with where clause including ValueObject,please? Mar 3, 2022
@effapp
Copy link
Author

effapp commented Mar 3, 2022

How to solve this issue, please?

@effapp
Copy link
Author

effapp commented Mar 4, 2022

How to query data with where clause including ValueObject,please?
public class Customer
{
public int CustomerID { get; set; }
public string Name { get; set; }
public Boolean IsActive { get; set; }
public MoneyValueObject Balance { get; set; }
}

public class MoneyValueObject
{
public float Amount { get; set; }
public string Currency { get; set; }
}

var customers=dbContext.Set().Where(o=>o.Banlance.Amount >50000).ToList();
but it throw exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant