Could I kindly ask you which version of Telerik Data Access
you would use and do you plan to use the Visual Designer
If so, the Visual Designer
does allow code generation modification. You should first copy the code generation templates locally, as described in this documentation article
(just the first step named: 1. Copy the Templates Locally
). Once you have the templates copied, please locate the Engine.ttinclude
and on line 86 please add the following code:
if(@class.BaseClass == null)
var baseClass = new Telerik.OpenAccess.CodeGeneration.CodeClass();
@class.BaseClass = baseClass;
Then please re-save the .rlinq
file, at that point all the classes should inherit from the YourNamespace.BaseX
If you chose this approach you should have in mind that we recommend the YourNamespace.BaseX
to be an abstract class as trying to persist instances of that class will result in an error. Another thing is that, if using xml mapping, you are not going to be able to map its properties to database columns.
With this approach you will grantee that all your classes have a common base class. If you have some further requirements please described them along with your implementation scenario in more detail. This will allow us to advice you better in that particular situation.
I hope this is helpful. Do not hesitate to contact us with any more questions.
Check out the latest announcement
about Telerik Data Access vNext as a powerful framework
able to solve core development problems.