Giter VIP home page Giter VIP logo

cm's Introduction

CM

ORM

  • 支持Oracle、SqlServer数据库 根据配置文件识别

    <add key="ConStr" value="Data Source=.;Initial Catalog=DBName;User ID= ;PassWord= " /> <add key="ConType" value="Sql"/>
    

  • 查询Select():查询所有,根据主键、lambda条件查询(数组.Contains()=in,字符串.Contains()=模糊查询)

  • 插入Insert():插入一条、多条

  • 插入一条返回主键 InsertReturnId()

  • 更新Update():更新一条、多条

  • 删除Delete():清空表,删除、删除多条,根据主键、Linq条件删除

  • CM.DB.Select(t => t.Content.StartsWith("1"));//模糊匹配,以该字符串开头的

  • CM.DB.Select(t => t.Content.EndsWith("2")); //模糊匹配,以该字符串结尾的

  • CM.DB.Select(t => t.Content.Contains("1")); //模糊匹配,任意位置包含该字符串的


调用:

 入口类CM调用接口DB
 对应MODEL需引用using CMDB;的名称空间 并在主键上加入 [Col_(IsPrimaryKey = true, IsIdentity = true)] 

所有数字类型皆需设置为可为空,方便更新

请注意每个方法都是泛型方法,T类型需与表名相同

cm's People

Contributors

yuchendaycode avatar

Stargazers

 avatar

Watchers

 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.