IsRequired + HasColumnType + UseCollation ERROR on EFCore

41 views
Skip to first unread message

Nes

unread,
Sep 9, 2023, 5:28:59 AM9/9/23
to firebird-net-provider
Hi everybody.

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  '?


Jiří Činčura

unread,
Sep 12, 2023, 8:47:30 AM9/12/23
to 'Mr. John' via firebird-net-provider
Hi, looks like a regular bug. Please create an item in https://github.com/FirebirdSQL/NETProvider/issues and I'll fix it. Or if you feel like, you can create PR for that.

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/
Reply all
Reply to author
Forward
0 new messages