예제 #1
0
        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);
            }
        }
예제 #2
0
 public UnitOfWork(ExampleContext context)
 {
     _context = context;
 }
예제 #3
0
 public GenericRepository(ExampleContext context)
 {
     _context = context;
 }
예제 #4
0
 public ProductRepository(ExampleContext context)
 {
     _context = context;
 }