• 大小: 0.01M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-26
  • 语言: C#
  • 标签: ORM  Dapper  

资源简介

[Introduction of the example] Demo.EntityFramework\Dapper Demo

[Screenshot of the example]


资源截图

代码片段和文件信息

using Dapper;
using DapperMySql.Entity;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Text;

namespace DapperMySql
{
    public class QueryService
    {
        private const string ConnectionString = “连接字符串“;
        public List GetList()
        {
            using (MySqlConnection connection = new MySqlConnection(ConnectionString))
            {
                return connection.Query(“select * from OperateTest“).AsList();
            }
        }

        public void Performance_All(int count)
        {
            using (MySqlConnection connection = new MySqlConnection(ConnectionString))
            {
                for (int i = 0; i < count; i++)
                {
                    var re = connection.Query(“select * from OperateTest“).AsList();
                }
            }
        }

        public OperateTest GetOne()
        {
            using (MySqlConnection connection = new MySqlConnec

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-08-21 10:11  Demo.ORM-master\
     文件        2518  2019-08-21 10:11  Demo.ORM-master\.gitattributes
     文件        5745  2019-08-21 10:11  Demo.ORM-master\.gitignore
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\
     文件         293  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\DapperMySql.csproj
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\Entity\
     文件         545  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\Entity\OperateTest.cs
     文件        1660  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\QueryService.cs
     文件          36  2019-08-21 10:11  Demo.ORM-master\CSharp\DapperMySql\ReadMe.md
     文件        2933  2019-08-21 10:11  Demo.ORM-master\CSharp\Demo.ORM.sln
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\Context\
     文件        2317  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\Context\SevenTinyTestContext.cs
     文件         651  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\EFCoreMySql.csproj
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\Entity\
     文件         545  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\Entity\OperateTest.cs
     文件         294  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\Entity\Student.cs
     文件         527  2019-08-21 10:11  Demo.ORM-master\CSharp\EFCoreMySql\ReadMe.md
     文件          45  2019-08-21 10:11  Demo.ORM-master\CSharp\README.md
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.DapperMySql\
     文件         608  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.DapperMySql\QueryTest.cs
     文件         584  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.DapperMySql\Test.DapperMySql.csproj
     目录           0  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.EFCoreMySql\
     文件         949  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.EFCoreMySql\QueryTest.cs
     文件         653  2019-08-21 10:11  Demo.ORM-master\CSharp\Test.EFCoreMySql\Test.EFCoreMySql.csproj

评论

共有 条评论