I\'m working on creating a generic repository for an EF Core project to avoid having to write CRUD for all models. A major roadblock I\'ve hit is navigation properties not b
private List GetNavigationProperties(GesFormaContext _gesFormaContext)
{
List propertyInfos = new List();
_gesFormaContext.Model.GetEntityTypes().Select(x => x.GetNavigations()).ToList().ForEach(entityTypes =>
{
entityTypes.ToList().ForEach(property =>
{
propertyInfos.AddRange(typeof(T).GetProperties().Where(x => x.PropertyType == property.PropertyInfo.PropertyType).ToList());
});
});
return propertyInfos;
}