Giter Site home page Giter Site logo

xinxindiandeng / tzm.xframework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tanzame/riz.xframework

0.0 1.0 0.0 43.19 MB

a lightweight and high performance ORM framework based on .net,keeping the original Microsoft API.

License: Apache License 2.0

C# 97.69% TSQL 0.78% PLSQL 1.50% Batchfile 0.03%

tzm.xframework's Introduction

🇨🇳 Riz.XFramework

NuGet stats GitHub license

Riz.XFramework 是一款基于.NET的轻量级高性能 ORM 框架,参考 EntiryFramework 的设计**,保留大量原汁原味的微软API,支持 Fx 4.0+ 和 DotNetCore3.1+。

功能特点

  • 原生 EF 语法,完整的代码注释,零门槛上手
  • 支持 Linq 查询、Lambda 表达式
  • 支持丰富的表达式函数、链式查询
  • 支持批量增删改查和多表关联更新
  • 支持 SqlServer、MySql、Postgre、Oracle、SQLite 等多种数据库
  • 支持 Postgre、Oracle 大小写敏感
  • 支持无限级一对一、一对多导航属性、延迟加载
  • 支持实体属性类型与数据库字段不同类型、不同名称映射
  • 支持多架构(schema)设计
  • 支持原生 Ado.Net、临时表、表变量、AOP操作

联系方式


快速开始

安装

PM> Install-Package Riz.XFramework
Database Package
SqlServer Riz.XFramework
MySql Riz.XFramework.MySql
Oracle Riz.XFramework.Oracle
Postgre Riz.XFramework.Postgre
SQLite Riz.XFramework.SQLite

定义实体

[Table(Name = "Bas_Client")]
public partial class Client
{
    [Column(IsKey = true)]
    public virtual int ClientId { get; set; }
    public virtual string ClientCode { get; set; }
    public virtual string ClientName { get; set; }
    public virtual int CloudServerId { get; set; }
    [ForeignKey("CloudServerId")]
    public IList<CloudServer> CloudServer { get; set; }
}

[Table(Name = "Sys_CloudServer")]
public partial class CloudServer
{
    [Column(IsKey = true)]
    public virtual int CloudServerId { get; set; }
    public virtual string CloudServerCode { get; set; }
    public virtual string CloudServerName { get; set; }
}

基本用法

// 声明数据库链接字符串
const string connString = "Server=.;Database=***;uid=**;pwd=**;pooling=true;connect timeout=10;";
// 实例化数据上下文
// SqlServer
var context = new SqlServerDbContext(connString);
var data = context.GetTable<Client>().Where(a => a.ClientId <= 10).ToList();
data = context
    .GetTable<Client>()
    .Include(a => a.CloudServer, a => new
    {
        CloudServerCode = a.CloudServer.CloudServerCode
    })
    .ToList();

📌 更详细教程 Wiki

支持作者

👍

tzm.xframework's People

Contributors

tanzame avatar

Watchers

James Cloos 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.