Skip to content

Commit cc80af9

Browse files
committed
use the type of the returned DbSet rather than the generic type to get the method
1 parent fec5f42 commit cc80af9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

JsonApiDotNetCore/Data/ResourceRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ private object GetEntityById(Type modelType, string id, string includedRelations
6767

6868
public void Add(object entity)
6969
{
70-
var dbSetAddMethod = typeof(DbSet<>).GetMethod("Add");
7170
var dbSet = GetDbSetFromContext(_context.Route.BaseRouteDefinition.ContextPropertyName);
71+
var dbSetAddMethod = dbSet.GetType().GetMethod("Add");
7272
dbSetAddMethod.Invoke(dbSet, new [] { entity });
7373
}
7474

0 commit comments

Comments
 (0)