I'm building a first MVC app in ASP.NET and I'm using link2SQL model to work with data. All tutorials on the microsoft site let you write LINQ code in the controller to get data and pass it to the view, like this:
Function Index() As ActionResult
Dim datacontext As New ErrorVaultDataContext
Dim questions = From q In datacontext.Questions
Where q.fk_status_id = 1
Order By q.date Descending
Select q
Return View(questions)
End Function
That works, but it's confusing me on where to place my business logic. I would like to implement business logic like "can this user get this data?" in this simple example.
Does anyone know how this works in conjunction with linq 2 SQL?