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)); }
public DataService() { BL = new BuisnessLogic(new DataAccess()); // BL.Property = new DataAccess(); // ((IDependency)BL).SetDependency(new DataAccess()); }