Is the following code considered efficient. I am using vb.net and linq to sql
Public Sub PassDeletion(ByVal GenEntID As Integer)
Dim db As New LinqDataAccess.QuantumDataContext
Dim Result1 = From CAdvs In db.CompanyAdvisors Where CAdvs.ComAdvEntityAdvisorID = GenEntID And CAdvs.ComAdvActiveFlag = True Select CAdvs
If Result1.Count > 0 Then
Throw New ValidationException("The Record you are about to set to Inactive is an entity Advisor. Current operation is aborted.")
End If
Dim Result2 = From CAdvs In db.CompanyAdvisors Where CAdvs.ComAdvCompanyID = GenEntID And CAdvs.ComAdvActiveFlag = True Select CAdvs
&nbs ...
Go to the complete details ...