You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue and don't know how to solve it. Having 4 string fields from one entity I decided to change one of them "SerialNumber" to a value object.
At some point having an IQueryable I need to filter for the items that contain a similar search term, in this example details. There is no problem with using .Contains for any string fields but when I change SerialNumber to ValueObject and I don't have the Contain method anymore.
returnquery.Where(x =>x.Number.Contains(details)||x.SerialNumber.Value.Contains(details)||//New field as string ValueObjectx.Name.Contains(details)||x.CarrierName.Contains(details));
I tried to use x.SerialNumber.Value.Contains(details), details.Contains(x.SerialNumber.Value) and some other approaches. And responding with the following error: Could not be translated
The text was updated successfully, but these errors were encountered:
This piece of code translated fine and worked like intended
You can even create interface and implement it in your ValueOf classes(this uses new static abstract methods of c# 11):
I have an issue and don't know how to solve it. Having 4 string fields from one entity I decided to change one of them "SerialNumber" to a value object.
At some point having an IQueryable I need to filter for the items that contain a similar search term, in this example
details
. There is no problem with using.Contains
for any string fields but when I changeSerialNumber
to ValueObject and I don't have the Contain method anymore.I tried to use
x.SerialNumber.Value.Contains(details)
,details.Contains(x.SerialNumber.Value)
and some other approaches. And responding with the following error:Could not be translated
The text was updated successfully, but these errors were encountered: