using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
using Autofac;
namespace AutofacDemo1
{
class Program
{
private static IContainer Container { get; set; }
static void Main(string[] args)
{
#region 普通的调用
//BMW bmw = new BMW();
//bmw.Create("730Li");
//Porsche porsche = new Porsche();
//porsche.Create("卡宴");
#endregion
#region 工厂的方式
//ICarCreator car = (ICarCreator)Assembly.GetExecutingAssembly().CreateInstance(ConfigurationManager.AppSettings["Brand"]); //使用了反射方式
//car.Create("suv");
#endregion
#region 使用Ioc[Autofac]
var builder = new ContainerBuilder();
builder.RegisterType<ICarCreator>();
builder.Reg