private static IEnumerable <WhiteLists> GetData(wt.WhiteListContext context, IMapper mapper)
        {
            var whiteLists = context
                             .Whitelists
                             .Include(x => x.Source)
                             .ToList();
            var wl2 = whiteLists
                      .Select(x => mapper.Map <WhiteLists>(x))
                      .ToList();

            context.Dispose();
            return(wl2);
        }
        internal static wt.WhiteListContext CreateContext(Sql sql, IWebHostEnvironment env)
        {
            DbContextOptionsBuilder <wt.WhiteListContext> op = new DbContextOptionsBuilder <wt.WhiteListContext>();

            sql.UseSqlService(op);
            if (env == null || env.IsDevelopment())
            {
                op
                .UseLoggerFactory(LoggerFactory.Create(builder =>
                {
                    builder.AddDebug().AddConsole();
                }))
                .EnableSensitiveDataLogging();
            }

            var context = new wt.WhiteListContext(op.Options);

            return(context);
        }