生成共同功能 [英] Generate Common Function
问题描述
我的SQL数据库(2008)中有30个表,每个表都是我的.Net项目中的Generat类。 (通过此应用程序 [ SQL和VB.NET代码生成器]) >
但问题是每个类都有相同的常用功能,如GetAllClient as datatable和GetAllSupplier as datatable....
i想要一种方法来创建一次函数并为我的所有类生成这些函数,我不想复制粘贴函数并重命名必须重命名的函数。
这些问题的最佳解决方案是什么?我有一个解决方案,但我不知道创建父类具有这些常见功能并且子继承它是否正确,这是一个很好的解决方案吗?
I have 30 Tables in my SQL Database (2008) and each of them i Generat class in my .Net project. ( by this application [SQL and VB.NET Code Generator] )
but the problem that every class has the same common function like "GetAllClient as datatable" And "GetAllSupplier as datatable" ....
i want a way to create one time the functions and generate these for all my classes, i don't want to copy paste the functions and rename the that what must rename .
what is the best solution for these issue ? i have a solution but i don't know if it correct that creating Father Class have these common functions and the child inherit it, is it good solution ?
推荐答案
阅读本文
构建您自己的通用数据访问层I [ ^ ]
这篇关于生成共同功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!