SqlDao 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SqlDao --version 1.0.0                
NuGet\Install-Package SqlDao -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SqlDao" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlDao --version 1.0.0                
#r "nuget: SqlDao, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SqlDao as a Cake Addin
#addin nuget:?package=SqlDao&version=1.0.0

// Install SqlDao as a Cake Tool
#tool nuget:?package=SqlDao&version=1.0.0                

SqlDao

项目介绍

C# 操作数据库ORM类库,支持所有支持标准Sql语句的主流数据库

软件架构

软件架构说明

安装教程
  1. clone 项目 用Vs2017 打开重先生成,把新生成的SqlDao.dll 添加到你的项目 还可以在你的项目里添加一个现有项,作为类库。在你的主项目时添加项目的引用

  2. 连接数据库字符串(和平时开发一样)

    connectionString="Database=ticket;Data Source=127.0.0.1;User Id=admin;Password=;pooling=false;CharSet=utf8;port=3306;"

  3. 连接数据库 (以mysql 为例)

    public class DatabaseOPtionHelper {

     private static DbHelper Instance;
    
    
     public static DbHelper GetInstance()
     {
         string conn = ConfigurationHelper.GetConnectionConfig(ConfigItemName.mysqlConn.ToString());
         Instance = new MySqlHelper(conn);
         App.Current.Dispatcher.BeginInvoke(new Action(delegate
         {
             if (Instance == null)
             {
                 Instance = new MySqlHelper(conn);
             }
         }));
         return Instance;
     }
    

    }

使用说明
  1. select

List<Company> tempList = CompanyModel.IndistinctSearchByNameOrNameFirstCase(tempStr);

 WeighingBillModel里的方法

  public static List<Company> IndistinctSearchByNameOrNameFirstCase(String nameOrCase)
    {
        string condition = null;
        if (!String.IsNullOrEmpty(nameOrCase))
        {
            condition = CompanyColumns.name.ToString() + " like '%" + nameOrCase + "%' " + " OR " +              CompanyColumns.name_first_case.ToString() + " like '%" + nameOrCase.ToUpper() + "%'";
        }
        String sql = DatabaseOPtionHelper.GetInstance().getSelectSql(TableName.company.ToString(), null, condition);
        List<Company> list = DatabaseOPtionHelper.GetInstance().select<Company>(sql);
        return list;
    }
  1. insert

    int res = WeighingBillModel.Create(mWeighingBill);

    WeighingBillModel里的方法

     public static int Create(WeighingBill mWeighingBill)
     {
         return DatabaseOPtionHelper.GetInstance().insert(mWeighingBill);
     }
    
  2. update

int res = WeighingBillModel.update(mWeighingBill);

WeighingBillModel里的方法

    public static int Create(WeighingBill mWeighingBill)
    {
        return DatabaseOPtionHelper.GetInstance().update(mWeighingBill);
    }

4.del

int res = WeighingBillModel.del(mWeighingBill);

WeighingBillModel里的方法

    public static int del(WeighingBill mWeighingBill)
    {
        return DatabaseOPtionHelper.GetInstance().del(mWeighingBill);
    }
  1. 类似 GreenDao 操作,功能大至相似
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SqlDao:

Package Downloads
clf.code.first

C# 代码到数据结构自动生成工具

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.8 230 4/11/2023
2.0.5 244 3/10/2023
2.0.4 250 3/8/2023
2.0.3 246 3/8/2023
2.0.2 229 3/7/2023
2.0.1 534 11/22/2022
2.0.0 858 11/21/2022
1.1.6 525 4/2/2021
1.1.5 465 12/15/2020
1.1.4 548 7/8/2020
1.1.3 687 3/18/2020
1.1.2 543 3/18/2020
1.1.1 566 3/18/2020
1.0.1 636 9/24/2019
1.0.0 510 9/10/2019

初始一个 Nuget 库