You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if dotnet ef migrations add would automatically add
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
to the beginning of generated file and
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
at the end of file.
I mean both (migrations and designer).
For example:
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace OpPIS.Web.Hosting.Migrations
{
public partial class Fix5 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "ParentAnchorX",
table: "VarDesign_Parameter-ImageManipulations",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ParentAnchorX",
table: "VarDesign_Parameter-ImageManipulations");
}
}
}
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
Reacted by Rob, monsieur xx, Benedikt Radtke and Adam Stachowicz
@MaklaCof We will have a think about adding XML comments to the generated code, but we don't plan to do it at the present time. Beyond that, we don't want to generate this pragma all the time because most people will not need it. However, there is a similar discussion about auto-generated in issue #10203. I posted a code snippet in that issue showing how to override the generator to add a line--this should also work for the pragma.
Reacted by Makla
Reacted by MichaelLHerman, J.M. Cummings, Zuhaib Zakaria, Alexander Blinne, Rory Apperson, egocarib, Jake O'Hara and lukich48
Together with this class somewhere in the starting assembly:
publicclassDesignTimeServices:IDesignTimeServices{/// <inheritdoc />publicvoidConfigureDesignTimeServices(IServiceCollectionservices){// Register custom migration generator which adds a pragma disable for xml-commentsservices.AddSingleton<IMigrationsCodeGenerator,FooMigrationsGenerator>();}}
Reacted by MichaelLHerman, Evgeniy Zyatyna, Hubert Morawski, LVK and Matt K
Activity
ajcvickers commentedon Jan 12, 2018
@MaklaCof We will have a think about adding XML comments to the generated code, but we don't plan to do it at the present time. Beyond that, we don't want to generate this pragma all the time because most people will not need it. However, there is a similar discussion about auto-generated in issue #10203. I posted a code snippet in that issue showing how to override the generator to add a line--this should also work for the pragma.
bobvandevijver commentedon Oct 31, 2018
For reference in this ticket, this is what I used to generate the pragma's:
Together with this class somewhere in the starting assembly:
MaklaCof commentedon Feb 2, 2020
This doesn't work anymore with version 3.1.1.
Namespace
Microsoft.EntityFrameworkCore.Migrations.Designcan not be found.ErikEJ commentedon Feb 2, 2020
@MaklaCof This? https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#dip
MaklaCof commentedon Feb 2, 2020
@ErikEJ Does anything else changed?
Class
CSharpEntityTypeGeneratoris found inusing Microsoft.EntityFrameworkCore.Scaffolding.Internal;But there are no methods:

GenerateMigration,GenerateSnapshot,GenerateMetadata.Only:
My Packages are:
ErikEJ commentedon Feb 2, 2020
Possibly, since you are using Internal classes
Ablinne commentedon May 8, 2020
I think this should really be implemented. The counter-arguments
are imho invalid, because:
roji commentedon Aug 11, 2020
Opening to re-discuss in triage.
14 remaining items
Add <inheritdoc /> in migrations
Add <inheritdoc /> in migrations
Add <inheritdoc /> in migrations
Add <inheritdoc /> in migrations (#27268)