コード例 #1
0
        static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();

            container.RegisterType <IDataAccess, DataAccess>();
            BuisnessLogic bl = container.Resolve <BuisnessLogic>();

            Console.WriteLine(bl.GetData(1));
            // DataService s = new DataService();
            // Console.WriteLine( s.GetData(1));
        }
コード例 #2
0
 public DataService()
 {
     BL = new BuisnessLogic(new DataAccess());
     // BL.Property = new DataAccess();
     //  ((IDependency)BL).SetDependency(new DataAccess());
 }