开发者

How To Produce The Data Classes in .NET 2.0 platform using c# : A case study to get the answer

开发者 https://www.devze.com 2023-02-25 08:08 出处:网络
I will show you my project to describe what I want to know about auto generation of code files: Here the image a开发者_JAVA技巧bout the project. You can see The Point A: A dataset which has three tab

I will show you my project to describe what I want to know about auto generation of code files:

Here the image a开发者_JAVA技巧bout the project. You can see The Point A: A dataset which has three tables inside. Then focus on the Point B. Please check the question below the image,

How To Produce The Data Classes in .NET 2.0 platform using c# : A case study to get the answer

I would like to generate the DataObjects (in the Point B). Let me introduce the data objects codes what likely to be generated:

For instance:

   public class _BundleFlowData_SpColumns : SpColumns
    {
        public override IList<ColumnNames> Columns
        {
            get
            {
                return new CollectionOf<ColumnNames>()
                    .Add(ColumnNames.WFInstanceId)
                    .Add(ColumnNames.IsCustomer)
          ...

Is it possible to create the data objects when I create the dataset or update the data set ? I heard about T4, Is it possible to do it with T4 (or any other solution will be perfect)? The data objects auto generation may be triggered by updating or creating the dataset in the main solution..


You can generate classes directly from the .xsd by using a tool such as Xsd2Code, which can be integrated into your build process.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号