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
// ID
public readonly partial record struct AddressId {
public AddressId(long raw) {
Raw = raw;
}
public long Raw { get; }
}
// Converter
public class AddressIdValueConverter : ValueConverter<AddressId, long> {
public AddressIdValueConverter()
: base(
v => v.Raw,
v => new(v)
) { }
}
// Registering it
configurationBuilder
.Properties<AddressId>()
.HaveConversion<AddressIdValueConverter>();
// The file is actually generated out of a name and type
// and contains a lot more (like json conversion, model binder, tostring)
Hi,
we use a custom type instead of long as a key.
Example:
Which works like a charm, except that
has no effect.
Though it can be set on a per property basis:
Used versions:
Npgsql (8.0.6)
Npgsql.EntityFrameworkCore.PostgreSQL (8.0.11)
in a .net 8 project with EF 8.*
It would be great if
UseIdentityAlwaysColumns
could also work in this case.The text was updated successfully, but these errors were encountered: