NETProvider icon indicating copy to clipboard operation
NETProvider copied to clipboard

IsRequired + HasColumnType + UseCollation ERROR on EFCore

Open nes4072gmail opened this issue 2 years ago • 0 comments

Using: Entity Framework Core ver 9.1.1 over NET 6. Server: Firebird 3.

A example Entity:

public class TABLE
{
    public int Id { get; set; }
    public string? Name { get; set; }
}

Modeling property:

modelBuilder.Entity<TABLE>().Property(P => P.Name)
    .IsRequired()
    .HasColumnType("varchar(25) character set UTF8")
    .UseCollation("UNICODE_CI_AI");

SQL behind generated:

"Name" varchar(25) character set UTF8 COLLATE UNICODE_CI_AI NOT NULL,

and throw exception:

FirebirdSql.Data.FirebirdClient.FbException: 'Dynamic SQL Error SQL error code = -104 Token unknown - line 3, column 65 NOT'

Should the word 'not null' go before of ' COLLATE UNICODE_CI_AI '?

nes4072gmail avatar Sep 16 '23 08:09 nes4072gmail