Open Jerther opened 8 years ago
For now I've figured I could declare my class like so as a workaround:
class FooCollection<T> : List<Foo>
where T : Foo
But I think we'll agree that we'd rather not do that... :)
Just modify the source code and add:
if (Accessor.PropertyType.BaseType.IsGenericType)
{
return Accessor.PropertyType.BaseType.GetGenericArguments()[0];
}
throw new InvalidOperationException("GraphDiff requires the collection to be either IEnumerable<T> or T[] or derived from GenericType");
I've added simple test for this and others were still green. Also it worked on my DB.
Thanks!!
I know you stopped supporting the project, but is there any chance for this to make it to the NuGet package?
@kotylo Thank you! Could you add a pull request with this modification and test, please?
@Dvornik, I just checked this on my collection. The fix may not be that simple, but it works for my simple entities. Created pull request here https://github.com/refactorthis/GraphDiff/pull/161
When calling OwnedCollection on a custom collection, I get the following error:
GraphDiff requires the collection to be either IEnumerable or T[]
The custom collection is something like:
The error seems to from this code:
Is there a workaround for this?