Ejemplo n.º 1
0
        /// <summary>
        /// Register All Business Services for DI
        /// </summary>
        /// <param name="services"></param>
        private static void RegisterBusinessServices(IServiceCollection services)
        {
            services.AddScoped <IGuestInfoService, GuestInfoService>((ctx) =>
            {
                IGuestInfoFactory factory = ctx.GetService <IGuestInfoFactory>();
                return(new GuestInfoService(factory));
            });

            services.AddScoped <IGuestInfoServiceTypeService, GuestInfoServiceTypeService>((ctx) =>
            {
                IGuestInfoServiceTypeFactory factory = ctx.GetService <IGuestInfoServiceTypeFactory>();
                return(new GuestInfoServiceTypeService(factory));
            });

            services.AddScoped <IEventService, EventService>((ctx) =>
            {
                IEventFactory factory = ctx.GetService <IEventFactory>();
                return(new EventService(factory));
            });

            services.AddScoped <IServiceTypeService, ServiceTypeService>((ctx) =>
            {
                IServiceTypeFactory factory = ctx.GetService <IServiceTypeFactory>();
                return(new ServiceTypeService(factory));
            });
        }
Ejemplo n.º 2
0
 public GuestInfoService(IGuestInfoFactory _guestInfoFactory)
 {
     guestInfoFactory = _guestInfoFactory;
 }