Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
729 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
services.AddTransient<Func<IUnitOfWork>>(implementationFactory: provider => new Func<IUnitOfWork>(IUnitOfWork () => { return provider.GetService<IUnitOfWork>(); } ));
Hello,
Could somebody develeloppe this funtion in multiple functions so I can try to anderstand ?
Thank you very much for your help
Hello,
Thank you for your help
I found my answer like this
var FUnit = new Func<IUnitOfWork>(target);
IUnitOfWork target()
{
return host.Services.GetService<IUnitOfWork>();
}
services.AddTransient<Func<IUnitOfWork>>((provider) => FUnit);