How can I configure the injection with partial class??
container.RegisterPerWebRequest<IDataContextAsync, DataBaseContext>();
container.RegisterPerWebRequest<IStoredProcedureContext, DataBaseContext>();
My code:
public partial class DataBaseContext : DataContext
public partial class DataBaseContext : IStoredProcedureContext
Error:
-[Torn Lifestyle] The registration for IStoredProcedureContext maps to the same implementation and lifestyle as the registration for IDataContextAsync does. They both map to DataBaseContext (Web Request). This will cause each registration to resolve to a different instance: each registration will have its own instance during a single Web Request. See the Error property for detailed information about the warnings. Please see https://simpleinjector.org/diagnostics how to fix problems and how to suppress individual warnings.
See here
var container = new Container();
container.Options.DefaultScopedLifestyle = new WebRequestLifestyle();
var registration = Lifestyle.Scoped.CreateRegistration<DataBaseContext>(container);
container.AddRegistration(typeof(IStoredProcedureContext), registration);
container.Verify();