im having an issue converting a query to a string...i did my research and found the majority of the answers were to attach first or single to the end of the query, which can be clearly seen.I thought this might of been a cache problem so cleaned the solution. in which i get a error below
Error 1 Cannot implicitly convert type 'JobTracker.Models.Location' to 'string'
Code in question:
public static string ClientIPName()
{
string ClientIP = null;
ClientIP = HttpContext.Current.Request.UserHostAddress;
return ClientIP;
}
public static string LocationIPAssign()
{
JobData db = new JobData();
var workstationLocation = ClientIPName();
var result = db.Locations
.Where(l => l.AssignedIP == workstationLocation)
.FirstOrDefault();
return result;
}
Initial error:
Cannot implicitly convert type System.Linq.IQueryable to string
Any ideas what could be causing this error?