A
Andy B.
I ran across this entity framework error: 'Like parameters must be of string
value.' Here is the line of code it mentioned:
Return DBContext.NewsArticles.Where("year(it.CreationDate) like @Year and
it.Archived = true", New ObjectParameter("Year",
Year)).OrderBy("it.CreationDate desc")
The Year parameter is a string since the function parameter was a string and
it got the value from a DropDownList.SelectedItem.Value which is also a
string. What is my problem and how would I fix it?
value.' Here is the line of code it mentioned:
Return DBContext.NewsArticles.Where("year(it.CreationDate) like @Year and
it.Archived = true", New ObjectParameter("Year",
Year)).OrderBy("it.CreationDate desc")
The Year parameter is a string since the function parameter was a string and
it got the value from a DropDownList.SelectedItem.Value which is also a
string. What is my problem and how would I fix it?