/// <summary>
        /// Initializes the container with a custom <see cref="ICreateInstance"/> type.
        /// </summary>
        /// <param name="getServiceBehavior">The instance that will be responsible for generating service instances.</param>
        /// <param name="factoryStorage">The <see cref="IFactoryStorage"/> instance responsible for determining which factory instance will instantiate a given service request.</param>
        public ServiceContainer(IGetService getServiceBehavior, IFactoryStorage factoryStorage)
        {
            if (getServiceBehavior == null)
                throw new ArgumentNullException("getServiceBehavior");

            if (factoryStorage == null)
                throw new ArgumentNullException("factoryStorage");

            _getServiceBehavior = getServiceBehavior;
            _factoryStorage = factoryStorage;

            this.AddDefaultServices();
        }
 /// <summary>
 /// Initializes the container with the default services.
 /// </summary>
 public ServiceContainer()
 {
     _getServiceBehavior = new DefaultGetServiceBehavior(this);
     this.AddDefaultServices();
 }
Beispiel #3
0
 public ViewModel()
 {
     _getService          = Startup.AutofacContainer.Resolve <IGetService>();
     _registrationContext = Startup.AutofacContainer.Resolve <RegistrationContext>();
 }
Beispiel #4
0
 public ViewModel(IGetService getService, RegistrationContext registrationContext)
 {
     _getService          = getService;
     _registrationContext = registrationContext;
 }
 public BookingDeleteService(IBookingRep repository, IGetService <IBookingContainer, Booking> bookingService)
 {
     _repository     = repository;
     booking_service = bookingService;
 }
 public BookingUpdateService(IBookingRep repository, IGetService <IBookingContainer, Booking> bookingService,
                             IGetService <IClientContainer, Client> clientService, IGetService <IRoomContainer, Room> roomService)
 {
     _repository     = repository;
     booking_service = bookingService;
     client_service  = clientService;
     room_service    = roomService;
 }