17 Replies
this is applicationDb file
this is program.cs file
as I understand it, it cannot create a
UnitOfWork
because it does not know how to make an Office.DataAccess.ApplicationDbContext
but you do register the context successfully
the ApplicationDbContext
added to the services in Program.cs is 100% Office.DataAccess.ApplicationDbContext
?yes
delete
/bin
and /obj
and run again? 😬
And where is it trying to create a IUnitOfWork
?here it is invoking applicationDbcontext in unitofwork
yeah but usually the error would also show that e.g. a controller requires
IUnitOfWork
here this is the project file see if you can solve
Your dbcontext seems to inherit from
IdentityDbContent
. But you haven't specified the IdentityUser.
Try this
Just a tips, don't use UnitOfWork. It's already kindof implemented in ef.
Also don't make your dbsets nullable
If you don't like the warning that it gives do something like this yeah building a repository atop of EF while still exposing its SaveChanges or IQueryable<T> is a pretty bad design pattern. It abstracts nothing and only limits the use of EF
Definitely!
@mer_nam hai bulla rakhta hu kula Have a look at this: https://github.com/WaadSulaiman/SocialMedia.Api
GitHub
GitHub - WaadSulaiman/SocialMedia.Api: A social media api using the...
A social media api using the onion architecture. You can interact with other users by posting, commenting, following and messaging. - GitHub - WaadSulaiman/SocialMedia.Api: A social media api using...
@SwaggerLife @Tvde1 thanks for input guys but this error is solved+ after posting this question in multiple servers for the error everyone discouraged me for those repository implementation next time I will keep this in mind
it's still good to practice and write code :)
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.
Closed!