小编Thi*_*iro的帖子

为什么Visual Studio在.Net Core上的工作WebAPI代码中报告lambda错误?

我将一个WebAPI从FullDotnet(4.6)迁移到.Net Core 2.0,我在使用Dapper的数据层中遇到了这个问题.

我的代码:

public List<Doctor> GetList()
{
    List<Doctor> ret;
    using (var db = GetMySqlConnection())
    {
        const string sql = @"SELECT D.Id, D.Bio, D.CRMState, D.CRMNumber,
        U.Id, U.Email, U.CreatedOn, U.LastLogon, U.Login, U.Name, U.Phone, U.Surname, U.Id, U.Birth, U.CPF,
        S.Id, S.Name
        from Doctor D
        inner join User U on U.Id = D.UserId
        inner join Speciality S on S.Id = D.IDEspeciality
        order by D.Id DESC";

        ret = db.Query<Doctor, User, Speciality, Doctor>(sql, (doctor, user, speciality) =>
        {
            doctor.User = user;
            doctor.Speciality = speciality;
            return doctor; …
Run Code Online (Sandbox Code Playgroud)

c# resharper lambda visual-studio asp.net-core

6
推荐指数
1
解决办法
307
查看次数

标签 统计

asp.net-core ×1

c# ×1

lambda ×1

resharper ×1

visual-studio ×1