Using linq to sql I would like to generate some sealed classes in a data context. Apparently that can’t be done.
When I try to extend a generated class, let’s say ApplicationUser by a partial part like this
sealed public partial class ApplicationUser
{ }
I get compilation errors (summarized)
‘SendPropertyChanging()’ is a new virtual member in sealed class ‘ApplicationUser’
and
‘SendPropertyChanged(string)’ is a new virtual member in sealed class ‘ApplicationUser’
obviously because these methods are generated as protected virtual.
Is there a way to let linq to sql generate selected (not all) classes as sealed?
You can generate a sealed class by editing the properties in the designer: