File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,10 @@ public IContextGraphBuilder AddDbContext<T>() where T : DbContext
195195
196196 private string GetResourceNameFromDbSetProperty ( PropertyInfo property , Type resourceType )
197197 {
198+ // this check is actually duplicated in the DefaultResourceNameFormatter
199+ // however, we perform it here so that we allow class attributes to be prioritized over
200+ // the DbSet attribute. Eventually, the DbSet attribute should be deprecated.
201+ //
198202 // check the class definition first
199203 // [Resource("models"] public class Model : Identifiable { /* ... */ }
200204 if ( resourceType . GetCustomAttribute ( typeof ( ResourceAttribute ) ) is ResourceAttribute classResourceAttribute )
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ public string FormatResourceName(Type type)
3535 {
3636 try
3737 {
38+ // check the class definition first
39+ // [Resource("models"] public class Model : Identifiable { /* ... */ }
3840 if ( type . GetCustomAttribute ( typeof ( ResourceAttribute ) ) is ResourceAttribute attribute )
3941 return attribute . ResourceName ;
4042
You can’t perform that action at this time.
0 commit comments