I'm fairly new to Linq and EF.
Any way the comparison of strings is incorrect?
I've already tried the String.Equals
or CompareTo
but those return boolean
values, i read for Linq
the comparison String == string
is like a WHERE statement
from SQL.
public IHttpActionResult GetMultifiberResult(string partNumber)
{
var list = db.MultifiberResults.Where(s => s.PartNumber ==
partNumber).ToList();
return Ok(list);
}
list should return a bunch of values where the column PartNumber from the DB is equal to parameter partNumber. When I search using int comparison it does find matches in an int column but not with varchar columns. Controller always returns empty and the count is 0.