Greetings,
In a current vs solution I have 2 projects, 1 holds the linq datacontext classes and another holds the business model.
Inside the business model I created a class which inherits from my datacontext like so;
Public Class <snip>DataModel
Inherits <snip>DataContext
In which I added a method which will trigger when ever a certain object is inserted.
Private Sub InsertToestel(ByVal instance As Entities.Toestel)
In this case when I call RinkelBVDataModel.Toestellen.Insertonsubmit(newToestel)
The aforementioned method is called instead of the default method generated by linq.
I made a testproject around this but whenever I add another method which adds a new object to the database I recieve a sqltimeout exception.
Example code;
Private Sub InsertToestel(ByVal instance As Entities.Toestel)
Dim ToestellenRepository As Model.Repositories.ToestellenRepository = New Model.Repositories.ToestellenRepository
ToestellenRepository.Add(instance)
End Sub
ToestellenRepository.Add would insert several other items besides instance to the database.
Does anyone know any specific fix for this? Or a better method to deal with business logic in the linq datacontext?
Thanks in advance.
In a current vs solution I have 2 projects, 1 holds the linq datacontext classes and another holds the business model.
Inside the business model I created a class which inherits from my datacontext like so;
Public Class <snip>DataModel
Inherits <snip>DataContext
In which I added a method which will trigger when ever a certain object is inserted.
Private Sub InsertToestel(ByVal instance As Entities.Toestel)
In this case when I call RinkelBVDataModel.Toestellen.Insertonsubmit(newToestel)
The aforementioned method is called instead of the default method generated by linq.
I made a testproject around this but whenever I add another method which adds a new object to the database I recieve a sqltimeout exception.
Example code;
Private Sub InsertToestel(ByVal instance As Entities.Toestel)
Dim ToestellenRepository As Model.Repositories.ToestellenRepository = New Model.Repositories.ToestellenRepository
ToestellenRepository.Add(instance)
End Sub
ToestellenRepository.Add would insert several other items besides instance to the database.
Does anyone know any specific fix for this? Or a better method to deal with business logic in the linq datacontext?
Thanks in advance.