 
      
    Google Play
- 1 ответ
- 0 вопросов
    2
    Вклад в тег
    
      
      
    
  
  
 
  
   
  
   
  
  class RepoModule : NinjectModule
{
    public override void Load()
    {
        Bind<ICategoryRepository>().To<CategoryRepository>();
        Bind<IProductRepository>().To<ProductRepository>();
    }
}
var modules = new INinjectModule[]
            {
                new RepoModule()
            };
            var kernel = new StandardKernel(modules);
            RegisterServices(kernel);
            return kernel;
public class ProductsController : Controller
{
    private readonly IProductRepository productRepository;
    public ProductsController(IProductRepository productRepository)
    {
        this.productRepository = productRepository;
    }
}
 
  
  Почему (?) мы можем объявить объект экземпляра вложенного класс (В) вот так:
new A.B()
Класс В не является статичным же.
И почему (?) мы не можем его определить вот так:
A a = new A();
new a.B();
public static class MyExtensionProvider
{
 public static void DoSomething(this Object targetObject)
 {
 return;
 }
}
