efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Add comments to the DbSet and Navigation in the T4 template

Open Varorbc opened this issue 1 year ago • 1 comments

https://github.com/dotnet/efcore/blob/315be6c768412f5e236e1cf1b0ffb1412de45e8e/src/EFCore.Design/Scaffolding/Internal/CSharpDbContextGenerator.tt#L62-L65

https://github.com/dotnet/efcore/blob/315be6c768412f5e236e1cf1b0ffb1412de45e8e/src/EFCore.Design/Scaffolding/Internal/CSharpEntityTypeGenerator.tt#L127

https://github.com/dotnet/efcore/blob/315be6c768412f5e236e1cf1b0ffb1412de45e8e/src/EFCore.Design/Scaffolding/Internal/CSharpEntityTypeGenerator.tt#L154

<#
    foreach (var entityType in Model.GetEntityTypes().Where(e => !e.IsSimpleManyToManyJoinEntityType()))
    {

    if (!string.IsNullOrEmpty(entityType.GetComment()))
    {
#>
    /// <summary>
    /// <#= code.XmlComment(entityType.GetComment()) #>
    /// </summary>
<#
    }
#>
    public virtual DbSet<<#= entityType.Name #>> <#= entityType.GetDbSetName() #> { get; set; }

Varorbc avatar Nov 30 '22 01:11 Varorbc