Open timg83 opened 6 years ago
Hello @timg83 ,
Do you think you could provide us a test project with this issue?
It will make easier/faster for my developer to getting started for investigating it.
We now always ask for a project since we found out that most issues are missing some essential information or are resolved by the requestor when creating it
(Even if the issue seem very easy to reproduce, by getting a test project, it allow us to give a faster support and better experience for the support of all our free libraries)
Best Regards,
Jonathan
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Bulk Operations • Dapper Plus • LinqToSql Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function
Please find attached the test project.
Thank you,
The request will be assigned to one of my developers.
Best Regards,
Jonathan
Hi.
Any news on this issue?
Hello @merken ,
The easy solution is to directly specify the foreign key
class Period : BaseEntity
{
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public virtual Accounting Accounting { get; set; }
[ForeignKey("Accounting")]
public int Account_Id { get; set; }
public bool IsOpen { get; set; }
}
We didn't success to make it automatically without adding the foreign key yet ;(
Best Regards,
Jonathan
Thanks for clarifying, @JonathanMagnan
Hi
Thanks for this awesome framework! Unfortunately we have a problem when querying an unfiltered entity and eager loading (include) a filtered entity.
Model
Filter OnModelCreating:
Program.TenantId is in reality the tenantId of our principal object so this changes dynamically.
Executed query:
Exception:
System.ApplicationException: 'FK Constriant not found for association 'EFDynamicFilters.Model.Period_Accounting' - must directly specify foreign keys on model to be able to apply this filter'
When executing the query starting from the tenantaware side =>
model.Accounting.Include(a => a.Periods).Where(a => a.IsOpen);
there is no problem.