C# 有人能解释这个没有代码体的类构造函数吗?

C# 有人能解释这个没有代码体的类构造函数吗?,c#,constructor,entity-framework-6,asp.net-identity,C#,Constructor,Entity Framework 6,Asp.net Identity,更多的是“为什么”而不是“如何”,但这怎么可能呢?因为我认为所有构造函数都需要一个代码块——即使其中没有任何代码块 以下代码直接取自的类定义 AspNet.Identity.EntityFramework.IdentityUser IdentityUser类的构造函数在定义中没有代码块?有人能解释一下吗 public class IdentityUser : IdentityUser<string, IdentityUserLogin, IdentityUserRole, Identity

更多的是“为什么”而不是“如何”,但这怎么可能呢?因为我认为所有构造函数都需要一个代码块——即使其中没有任何代码块

以下代码直接取自的类定义

AspNet.Identity.EntityFramework.IdentityUser

IdentityUser
类的构造函数在定义中没有代码块?有人能解释一下吗

public class IdentityUser : IdentityUser<string, IdentityUserLogin, IdentityUserRole, IdentityUserClaim>, IUser, IUser<string>
{
    //
    // Summary:
    //     Constructor which creates a new Guid for the Id
    public IdentityUser();

    //
    // Summary:
    //     Constructor that takes a userName
    public IdentityUser(string userName);
}
public class IdentityUser:IdentityUser,IUser,IUser
{
//
//总结:
//为Id创建新Guid的构造函数
公共身份识别器();
//
//总结:
//接受用户名的构造函数
公共标识用户(字符串用户名);
}

这是Visual Studio的Go To Definition服务从程序集元数据生成的伪代码

它不是真正的代码,也不会真正编译

您可以在“文件”顶部的注释中看到这一点。

请参见: