public static IServiceCollection AddProductModule(this IServiceCollection services, ProductModuleOptions moduleOptions)
        {
            services.Configure <ProductModuleOptions>(op =>
            {
                op.ConnectionStrings = moduleOptions.ConnectionStrings;
            });

            services.AddDbContext <ProductDbContext>(options => options.UseSqlServer(moduleOptions.ConnectionStrings.Default, sql =>
            {
                if (!string.IsNullOrEmpty(moduleOptions.ConnectionStrings.MigrationsAssembly))
                {
                    sql.MigrationsAssembly(moduleOptions.ConnectionStrings.MigrationsAssembly);
                }
            }));

            services
            .AddScoped <IRepository <Product, Guid>, Repository <Product, Guid> >()
            .AddScoped(typeof(IProductRepository), typeof(ProductRepository));

            DomainEvents.RegisterHandlers(Assembly.GetExecutingAssembly(), services);

            services.AddMessageHandlers(Assembly.GetExecutingAssembly());

            services.AddAuthorizationPolicies(Assembly.GetExecutingAssembly());

            return(services);
        }