File tree 2 files changed +6
-0
lines changed
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
195
195
196
196
private string GetResourceNameFromDbSetProperty ( PropertyInfo property , Type resourceType )
197
197
{
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
+ //
198
202
// check the class definition first
199
203
// [Resource("models"] public class Model : Identifiable { /* ... */ }
200
204
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)
35
35
{
36
36
try
37
37
{
38
+ // check the class definition first
39
+ // [Resource("models"] public class Model : Identifiable { /* ... */ }
38
40
if ( type . GetCustomAttribute ( typeof ( ResourceAttribute ) ) is ResourceAttribute attribute )
39
41
return attribute . ResourceName ;
40
42
You can’t perform that action at this time.
0 commit comments