Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnitOfWorkInterception problem when use IDapperRepository<TEntity,TPrimaryKey> #2283

Closed
osoykan opened this issue Jul 1, 2017 · 3 comments
Closed
Milestone

Comments

@osoykan
Copy link
Contributor

osoykan commented Jul 1, 2017

After investigating this problem, it seems to related with Castle.Core's Invocation.MethodInvocationTarget on UnitOfWorkInterceptor. In some cases Invocation.MethodInvocationTarget comes null and throws exception while intercepting.

If we change the code
from _unitOfWorkOptions.GetUnitOfWorkAttributeOrNull(invocation.MethodInvocationTarget);
to _unitOfWorkOptions.GetUnitOfWorkAttributeOrNull(invocation.GetConcreteMethod());

the problem is solved.

So @hikalkan,
Can we change the way of getting MethodInfo like above ? Is there any boundary or implementation exception to left as MethodInvocationTarget ?

PR Branch and commit for fix : https://github.com/osoykan/aspnetboilerplate/commit/baf68fd5a3664353099fb469c5e650409139fe79

@hikalkan
Copy link
Member

hikalkan commented Jul 2, 2017

I haven't known that there is a GetConcreteMethod method. You can send it as PR. Thanks a lot.

@hikalkan hikalkan added this to the v2.2 milestone Jul 2, 2017
@osoykan
Copy link
Contributor Author

osoykan commented Jul 2, 2017

opened, #2284

@hikalkan
Copy link
Member

hikalkan commented Jul 2, 2017

Thanks.

hikalkan added a commit that referenced this issue Jul 2, 2017
@hikalkan hikalkan closed this as completed Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants