sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
706 stars 230 forks source link

.HasName is obsolete: Use HasDatabaseName() instead #745

Closed dlubart closed 2 years ago

dlubart commented 2 years ago

I am on .Net Core 6 with latest updates. v3.6.0 of the TT include file.

My indexes all generate this warning in the .cs file (which I know has been a previous issue that you indicated was fixed a while back).

Warning CS0618 'RelationalIndexBuilderExtensions.HasName(IndexBuilder, string?)' is obsolete: 'Use HasDatabaseName() instead.'

It doesn't seem to interfere with anything but is there anything I might be doing that is causing it that I can remediate?

Thanks.

sjh37 commented 2 years ago

It does use HasDatabaseName if

Settings.TemplateType = TemplateType.EfCore6;

Can you check what settings you are using in your <database>.tt file

dlubart commented 2 years ago

It was at .EfCore3. I raised to EfCore6 and got an error:

I set it back to EfCore5 and it seems to be okay. Should EfCore6 work as well?

sjh37 commented 2 years ago

The TemplateType enum inside EF.Reverse.POCO.v3.ttinclude should look like this:

public enum TemplateType
{
    Ef6,
    EfCore2,
    EfCore3,
    EfCore5,
    EfCore6,
    FileBasedCore2,
    FileBasedCore3,
    FileBasedCore5,
    FileBasedCore6
}

Can you please check. Grab the latest .ttinclude file from here EF.Reverse.POCO.v3.ttinclude

dlubart commented 2 years ago

This is the issue. I have 3.6.0 of the ttinclude file, but my enum is this:

public enum TemplateType { Ef6, EfCore2, EfCore3, EfCore5, FileBasedCore2, FileBasedCore3, FileBasedCore5 }

Was this updated without a version change somehow? I can pull the latest file in but I just did this on 12/23 and thought I had the latest at that time.

sjh37 commented 2 years ago

You probably pulled in the latest code from github before I had officially released it. I will close this issue.