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
I have a Table TmTvEpisode with a Contraint:
CONSTRAINT [FK_TmTvEpisode_TmTvSeasons] FOREIGN KEY ([ShowId], [SeasonId]) REFERENCES [TmTvSeason]([ShowId], [Id]) ON DELETE CASCADE,
The Foreign key points to the Table TmTvSeason
After running your Tool (setting Plural. = false and "use table and columnnames directly from Database = true) :
In the generatetd Entity TmTvEpisode the Property fort he Foreignkey property is:
public virtual TmTvSeason S { get; set; }
Renaming the table tot he german word „Staffel“ doesnt help.
Steps to reproduce
1st
Create Tables:
CREATE TABLE [dbo].[TmTvPerson]
(
[Id] INT NOT NULL,
[CreditId] NVARCHAR(50) NULL,
[Adult] BIT NULL,
[Gender] TINYINT NULL,
[Name] NVARCHAR(50) NULL,
[OriginalName] NVARCHAR(100) NULL,
[KnownForDepartment] NVARCHAR(20) NULL,
[Popularity] FLOAT NULL,
[ProfilePath] NVARCHAR(75) NULL,
[TheProfile] VARBINARY(MAX) NULL,
CONSTRAINT [PK_TmPerson] PRIMARY KEY ([Id]),
)
CREATE TABLE [dbo].[TmTvEpisode]
(
[Id] INT NOT NULL,
[SeasonId] INT NOT NULL,
[ShowId] INT NOT NULL,
[AirDate] Date NULL,
[EpisodeNumber] INT NULL,
[Name] NVARCHAR(300) NULL,
[Overview] NVARCHAR(MAX) NULL,
[ProductionCode] NVARCHAR(20) NULL,
[SeasonNumber] INT NULL,
[StillPath] NVARCHAR(300) NULL,
[VoteAverage] FLOAT NULL,
[VoteCount] INT NULL,
[TheStill] VARBINARY (MAX) NULL,
[File] NVARCHAR(MAX) NULL,
[TvEpisodeAdded] DATETIME NULL,
[LastView] DATETIME NULL,
[MediaInfo] NVARCHAR(MAX) NULL,
[VideoResolution] NCHAR(10) NULL,
[Codec] NCHAR(100) NULL,
[Gesehen] BIT NULL,
[KodiId] NCHAR(10) NULL,
[KodiPlayCount] INT NULL,
[Runtime] INT NULL,
[FileSize] BIGINT NULL,
CONSTRAINT [PK_TmTvEpisode] PRIMARY KEY ([ShowId], [SeasonId], [Id]),
CONSTRAINT [FK_TmTvEpisode_TmTvSeasons] FOREIGN KEY ([ShowId], [SeasonId]) REFERENCES [TmTvSeason]([ShowId], [Id]) ON DELETE CASCADE,
)
Run your tool with following Settings:
after that the generatet Entity Episode has a navigation property
public virtual TmTvSeason S { get; set; }
but it should be
public virtual TmTvSeason TmTvSeason { get; set; }
Further technical details
EF Core version in use: EF Core 6
Is Handlebars used: no
EF Core Power Tools: 2.5.918
Database engine: SQL Server
Visual Studio version: Visual Studio 2022
Regards Wolfgang
The text was updated successfully, but these errors were encountered:
I have a Table TmTvEpisode with a Contraint:
CONSTRAINT [FK_TmTvEpisode_TmTvSeasons] FOREIGN KEY ([ShowId], [SeasonId]) REFERENCES [TmTvSeason]([ShowId], [Id]) ON DELETE CASCADE,
The Foreign key points to the Table TmTvSeason
After running your Tool (setting Plural. = false and "use table and columnnames directly from Database = true) :
In the generatetd Entity TmTvEpisode the Property fort he Foreignkey property is:
public virtual TmTvSeason S { get; set; }
Renaming the table tot he german word „Staffel“ doesnt help.
Steps to reproduce
1st
Create Tables:
CREATE TABLE [dbo].[TmTvPerson]
(
[Id] INT NOT NULL,
[CreditId] NVARCHAR(50) NULL,
[Adult] BIT NULL,
[Gender] TINYINT NULL,
[Name] NVARCHAR(50) NULL,
[OriginalName] NVARCHAR(100) NULL,
[KnownForDepartment] NVARCHAR(20) NULL,
[Popularity] FLOAT NULL,
[ProfilePath] NVARCHAR(75) NULL,
[TheProfile] VARBINARY(MAX) NULL,
CONSTRAINT [PK_TmPerson] PRIMARY KEY ([Id]),
)
CREATE TABLE [dbo].[TmTvEpisode]
(
[Id] INT NOT NULL,
[SeasonId] INT NOT NULL,
[ShowId] INT NOT NULL,
[AirDate] Date NULL,
[EpisodeNumber] INT NULL,
[Name] NVARCHAR(300) NULL,
[Overview] NVARCHAR(MAX) NULL,
[ProductionCode] NVARCHAR(20) NULL,
[SeasonNumber] INT NULL,
[StillPath] NVARCHAR(300) NULL,
[VoteAverage] FLOAT NULL,
[VoteCount] INT NULL,
[TheStill] VARBINARY (MAX) NULL,
[File] NVARCHAR(MAX) NULL,
[TvEpisodeAdded] DATETIME NULL,
[LastView] DATETIME NULL,
[MediaInfo] NVARCHAR(MAX) NULL,
[VideoResolution] NCHAR(10) NULL,
[Codec] NCHAR(100) NULL,
[Gesehen] BIT NULL,
[KodiId] NCHAR(10) NULL,
[KodiPlayCount] INT NULL,
[Runtime] INT NULL,
[FileSize] BIGINT NULL,
CONSTRAINT [PK_TmTvEpisode] PRIMARY KEY ([ShowId], [SeasonId], [Id]),
CONSTRAINT [FK_TmTvEpisode_TmTvSeasons] FOREIGN KEY ([ShowId], [SeasonId]) REFERENCES [TmTvSeason]([ShowId], [Id]) ON DELETE CASCADE,
)
Run your tool with following Settings:
after that the generatet Entity Episode has a navigation property
public virtual TmTvSeason S { get; set; }
but it should be
public virtual TmTvSeason TmTvSeason { get; set; }
Further technical details
EF Core version in use: EF Core 6
Is Handlebars used: no
EF Core Power Tools: 2.5.918
Database engine: SQL Server
Visual Studio version: Visual Studio 2022
Regards Wolfgang
The text was updated successfully, but these errors were encountered: