Hi, I'm trying to incorporate your excellent library into my EFCore model classes, for example:
public partial class Account
{
public Account()
{
WorkerGroups = new HashSet<WorkerGroup>();
}
public LongId Id { get; set; }
public DateTime? Created { get; set; }
public DateTime? AgreedToTermsOn { get; set; }
public NameLabel Name { get; set; }
public GuidStr ApiKey { get; set; }
public string CustomUrl { get; set; }
public virtual ICollection<WorkerGroup> WorkerGroups { get; set; }
}
Where LongId, NameLabel, GuidStr have C# primitive types of long, string, string respectively, with appropriate validation checks (e.g. under a certain length for NameLabel, and of certain format for GuidStr).
The code compiles fine, however when I actually try to fetch one of the above record from the database, I'm running into this error: System.InvalidOperationException: The property 'Account.Id' is of type 'LongId' which is not supported by the current database provider. Either change the property CLR type, or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.
I also tried to annotate the model with something like [Column(TypeName = "bigint")] on the Id property for example, and it didn't do anything. So I just wanted to ask you if what I'm trying to do is reasonable and/or feasible. Maybe I should just return to using primitive C# types?
Hi, I'm trying to incorporate your excellent library into my EFCore model classes, for example:
Where
LongId,NameLabel,GuidStrhave C# primitive types oflong,string,stringrespectively, with appropriate validation checks (e.g. under a certain length forNameLabel, and of certain format forGuidStr).The code compiles fine, however when I actually try to fetch one of the above record from the database, I'm running into this error:
System.InvalidOperationException: The property 'Account.Id' is of type 'LongId' which is not supported by the current database provider. Either change the property CLR type, or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.I also tried to annotate the model with something like
[Column(TypeName = "bigint")]on theIdproperty for example, and it didn't do anything. So I just wanted to ask you if what I'm trying to do is reasonable and/or feasible. Maybe I should just return to using primitive C# types?