public static async Task SeedAsync(
            InventoryDBContext context,
            ILoggerFactory loggerFactory
            )
        {
            try
            {
                context.Database.EnsureCreated();

                if (!context.Devices.Any())
                {
                    await MigrationRepository <Category> .JsonToList(DeviceCategorySeed.Json, context);

                    await MigrationRepository <Maker> .JsonToList(DeviceMakerSeed.Json, context);

                    await MigrationRepository <Device> .JsonToList(DeviceSeed.Json, context);

                    await MigrationRepository <Employee> .JsonToList(EmployeeSeed.Json, context);

                    await MigrationRepository <EmployeeDevice> .JsonToList(EmployeeDeviceSeed.Json, context);
                }
            }
            catch (Exception ex)
            {
                var logger = loggerFactory.CreateLogger <InventoryDBContext>();
                logger.LogError(ex.Message);
                logger.LogError(ex.InnerException.Message);
            }
        }
        internal static async Task JsonToList(string jsonData, InventoryDBContext context)
        {
            var objectList = JsonConvert.DeserializeObject <List <T> >(jsonData);

            Console.Write($"Creating {objectList.Count()} records{Environment.NewLine}");

            objSet = context.Set <T>();
            foreach (var item in objectList)
            {
                await objSet.AddAsync(item);

                await context.SaveChangesAsync();
            }
        }
 public Repository(InventoryDBContext dbContext)
 {
     _dbContext = dbContext;
 }