Coder Social home page Coder Social logo

excel2csharp's Introduction

Excel2CSharp

较为新颖的直接生成数据代码的C#配表工具!!!

优势

  1. 很容易解析,new一个就OK,几乎没什么学习成本,配表 ->生成->new()
  2. CLR的对象分配速度比较快
  3. 有很完善的主键冲突分析,类型分析
  4. 能自己拓展超级多的类型,比如原生的Func(不比解释器的公式强?),Vector,struct
  5. 热更? 用HybridCLR或者ILRuntime把生成的代码当作一个数据dll!

Excel

image

转为C#

using System;
using System.Collections;
using System.Collections.Generic;
namespace AirFramework.ConstModel
{
    public class Testdata
    {
        [AirFramework.PrimaryKey]
        public System.Int32 id = default;
        public System.Int32 value = default;
    }

    public class TestdataModel : AirFramework.IModel
    {
        public System.Collections.Generic.List<Testdata> Data = new System.Collections.Generic.List<Testdata>()
        {
new Testdata(){id = 3,value = 336}
,new Testdata(){id = 4,value = 337}
,new Testdata(){id = 5,value = 338}
,new Testdata(){id = 6,value = 339}
,new Testdata(){id = 7,value = 340}
,new Testdata(){id = 8,value = 341}
,new Testdata(){id = 9,value = 342}
,new Testdata(){id = 10,value = 343}
,new Testdata(){id = 11,value = 336}
        };

        private System.Collections.Generic.Dictionary<System.Int32,Testdata> dataMap = null;
        public System.Collections.Generic.Dictionary<System.Int32,Testdata> DataMap 
        {
            get
            {
                if(dataMap==null) dataMap = new System.Collections.Generic.Dictionary<System.Int32,Testdata>();
                foreach(var item in Data)
                {
                    DataMap.Add(item.id,item);
                }
                return dataMap;
            }

        }
        public TestdataModel(){}
    }
}


拓展类型规则

简单的很,加个特性,只需要返回字符串,或者抛异常,然后添加策略

image

#拓展分析规则 同理 image

excel2csharp's People

Contributors

yueh0607 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.