Closed wiggydave10 closed 6 years ago
@wiggydave10 Thanks for the bug report. I'll try to make a sweep of Lamar issues tomorrow and over the weekend to get this one address (won't be any big deal, I'll just make the naming use the generic arg to avoid the collisions).
However, I'd strongly advise against the IRepository<T>
thing though, but that has nothing to do with Lamar.
@jeremydmiller Thanks. I've since changed and no longer need to pass the in IRepository<T>
, but thought I'd still report. Out of interest could you elaborate on why you strongly advise against using the IRepository<T>
?
Is there a fix coming up for this problem, I'm running into it as well. Plus I'm also interested in why it is you strongly advice against using IRepository
Thanks you in advance!
@wiggydave10 Yes (worked on it a touch last night), and the IRepository<T>
just adds too much ceremony for new real value to me. It forces you to create all those little objects and hides all the power and most of the functionality of your data access tool.
Finally.
Recently I discovered a problem where we're trying to use 4 repositories in a service caused compilation errors. It seems as though when it's creating the repositories the local variables are being duplicated, 2x repository1 and 2x repository2.
I've tried reproducing the problem in a brand new test project and I get the same results. I notice that if I inject 4 services, each with there own interface, I do not have this issue, but once injecting 4 services/repositories with the same generic interface the problem occurs. The error produced by lamar is at the bottom.
Please see attached project to assist with reproduction of issue. You should just be able to run the project with IIS Express and once the page has loaded you'rll see the error message.
I have a
.NET Core 2.1 web app
,Lamar 1.1.2
andLamar.Microsoft.DependencyInjection 1.1.2
UserService.cs that lamar cannot create cannot create
Error shown by lamar:
LamarBugTesting.zip