예제 #1
0
        // Inject hai dịch vụ qua phương thức khởi tạo
        //Khởi tạo có Inject Option từ DI Container (chú ý tham số IOptions<TestOptions>)

        public ProductController(IListProductName lsphone, LaptopName lslaptop, IOptions <TestOptions> options)
        {
            Console.WriteLine(this.GetType().Name + " created");
            this.lsPhone  = lsphone;
            this.lsLaptop = lslaptop;
            this.options  = options.Value;
        }
예제 #2
0
 // Inject hai dịch vụ qua phương thức khởi tạo
 public ProductController(IListProductName lsphone, LaptopName lslaptop)
 {
     Console.WriteLine(this.GetType().Name + " created");
     this.lsPhone  = lsphone;
     this.lsLaptop = lslaptop;
 }
예제 #3
0
 // Inject hai dịch vụ qua phương thức khởi tạo
 //Khởi tạo có Inject Option từ DI Container (chú ý tham số IOptions<TestOptions>)
 public ProductController(IListProductName lsphone, LaptopName lslaptop, IOptions <TestOptions> options)
 {
     this.lsPhone  = lsphone;
     this.lsLaptop = lslaptop;
     this.options  = options.Value;
 }
예제 #4
0
 public ProductController(IListProductName lsPhone, IListProductName lsLaptop, IOptions <TestOptions> options)
 {
     this.lsPhone  = lsPhone;
     this.lsLaptop = lsLaptop;
     this.lvOption = options;
 }