When getting entities from database I do something like this :
using (MyAppEntities context = new MyAppEntities ())
{
adCategoryPresets.AddRange(context.AdCategoryPresets.Where(...).ToList());
}
The problem now is that AdCategoryPresets contains a column(string) that I need to split(“,”) and then compare to a integer. Is this possible? I can´t get it to work? Is there another way?
Edit1: The string that I need to compare my int to could look like this :
“5,6,9”, “52,55,3” or just “5”
This was solved by adding “|” to the start and end of the string like this “|2|55|23|553|” this makes it easier to match for example “|5|”.