Skip to content

KasimYe/WebApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DotNet First Core WebApi

==========================

备忘、记录


Dapper调用存储过程的坑

--返回值有null时泛型运行null

param.Get("@SupplierReturn")
	//报错信息
	//Attempting to cast a DBNull to a non nullable type! Note that out/return parameters will not have updated values until the data stream completes (after the 'foreach' for Query(..., buffered: false), or after the GridReader has been disposed for QueryMultiple)

连接池满的问题

--一直用ado.net操作数据库基本上不会遇到这个问题,用框架第一次遇到

using(Connection)
	{
		……
		Connection.Close();
		Connection.Dispose();
	}

--这样的写法依然没有解决问题,最后在工厂类申明的地方判断并且关闭解决的问题

if (_connection != null)
    {
        if (_connection.State != ConnectionState.Closed)
        {
            _connection.Close();
        }
        _connection.Dispose();
        _connection = null;
    }

About

自用WebApi

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages