public static async Task SeedAsync(ExampleContext context, ILoggerFactory loggerFactory)
        {
            try
            {
                var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

                await context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                var logger = loggerFactory.CreateLogger <ExampleContext>();
                logger.LogError(ex.Message);
            }
        }
Example #2
0
 public UnitOfWork(ExampleContext context)
 {
     _context = context;
 }
 public GenericRepository(ExampleContext context)
 {
     _context = context;
 }
 public ProductRepository(ExampleContext context)
 {
     _context = context;
 }