I have a list of strings like this
list = {a,b,c}
I would like to compare it in the database but I'm not sure how to go about doing that. This is my linq query:
var initialData = (from item in dbContext.DocumentCategories
join df in dbContext.DocumentFields
on item.Id equals df.DocumentCategoriesId
join dfs in dbContext.DocumentFieldsStore
on df.Id equals dfs.DocumentFieldsId
select new SearchDocumentsListViewModel
{
CategoryId = item.Id,
DocumentId = dfs.DocumentsId,
FieldId = df.Id,
Data = dfs.Data
})
.ToList();
initialData = initialData
.Where(u => u.Data.Contains(list))
.ToList();
Currently its showing me this error:
cannot convert from 'System.Collections.Generic.List' to 'char'
Not sure what that means
Whereat the end be flipped to.Where(u => list.Contains(u.Data))? Seems like data might be a string.