使用异步等待关键字小巧玲珑 [英] Using Async Await keywords with Dapper

查看:142
本文介绍了使用异步等待关键字小巧玲珑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一个微型ORM,决定去与精致小巧。

I want to use a micro-orm and decided to go with Dapper.

但似乎无法找到任何提到它配套的新型异步/等待语法。异步查询是对我很重要。

But can't seem to find any mentions of it supporting the new async/await syntax. Async queries are important for me.

有人可以提供一个异步查询中使用的await关键字与小巧玲珑正在取得的code例子吗?

Can someone provide a code example of an async query being made with Dapper using the await keyword ?

推荐答案

针对小巧玲珑.NET 4.5的时候有使用TPL全力支持,通过这些方法在结束异步* - QueryAsync等具体来说,.NET 4.5版本包括< A HREF =htt​​ps://github.com/StackExchange/dapper-dot-net/blob/master/Dapper/SqlMapper.Async.cs>这个额外的一套方法

Dapper when targeting .NET 4.5 has full support for TPL usage, via the methods ending in *Async - QueryAsync etc. Specifically, the .NET 4.5 build includes this extra set of methods

这篇关于使用异步等待关键字小巧玲珑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆