Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Person
- {
- [Dependency]
- public IStudent Student { get; set; }
- [Dependency]
- public ITeacher Teacher { get; set; }
- public Person()
- {
- }
- public void SendNotification()
- {
- if(Student != null)
- {
- Student.SentMessage("This is a Test Message");
- }
- }
- }
- IUnityContainer container = new UnityContainer();
- container.LoadConfiguration();
- Person p = (Person)Activator.CreateInstance(typeof(Person));
- Person builtUpPerson = (Person)container.BuildUp<Person>(p);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement