Ok, the method I posted previously wasn't good enough. There is no handling for null result. Updated method:
public static ThisTable GetUser(int uid)
{
DataClasses1DataContext dataContext = new DataClasses1DataContext();
ThisTable myTable = new ThisTable();
ISingleResult result = dataContext.GetUser(uid);
var details = result.ToList();
if (details.Count > 0)
{
myTable = details[0];
}
return myTable;
}
No comments:
Post a Comment