I understand that the linq to sql classes I included in my project are the data access layer. I also understand that I need to have any code that connects to, retrieves records, creates records or updates a table separate from my business logic. so lets say for example i have this code written in vb:
private function getUserID (byval strUserName as string) as guid
dim db as new myDataContext
dim idUser as guid = (From u in db.users _
Where u.username.equals(strUserName) _
Select u.id).SingleOrDefault
end function
This function is in my code behind file for the moment which is wrong, I understand this. My question is, should I create a new class that inherits from the linq class 'User' and implement the data access methods and functions there, or is it best to include this code in the data base (stored procedures I think)?