My Serial object contains the following values
string Class
int Product
int Code
Together they form a Serial Number. Note that 2 of them are integers.
Class + Product.ToString() + "-" + Code.ToString()
I am attempting to filter based on a string. Example:
serials = _context.Serials.AsQueryable();
serials = serials.Where(serial => serial.Class.Contains(searchText));
I am looking to perform a .Contains() on the concatenated SerialNumber. How would I perform this in EF Core?
Something like this does not work. Throwing an error about query not being translated.
serials = serials.Where(serial => string.Concat(serial.ProductClass, serial.ProductNumber.ToString(), serial.CodeNumber.ToString()).Contains(searchText))