How can I register class who don't have Interface and after this get his services.Project is in .NET 4.5 MVC.I try use SimpleInjector for first time and make method ConfigureServices in Startup class.My class is:
public class LawyersDB : DBFunction
{
#region "MemberFields"
Int16 _CommandTimeout;
#endregion
#region Constructors
public LawyersDB()
{
_CommandTimeout = 300;
}
public LawyersDB(SQLDatabase conDatabase) :
base(conDatabase)
{
_CommandTimeout = 300;
}
#endregion
#region LIST
Simpleinjector doesn't like classes or services having multiple constructors. It considers them a code smell IIRC.
You could do something like:
container.Register(() => new LawyersDb(container.GetInstance(typeof(SQLDatabase)), Lifestyle.Scoped);
You'd need to set your scoping and get the instance of the SQLDatabase that you want to use in the class.