Exemplo n.º 1
0
        public async Task InsertDockerSampleData(DockerCommandsDbContext db)
        {
            var commands = GetDockerCommands();

            db.DockerCommands.AddRange(commands);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (Exception exp)
            {
                _logger.LogError($"Error in {nameof(DockerCommandsDbSeeder)}: " + exp.Message);
            }
        }
Exemplo n.º 2
0
 public DockerCommandsRepository(DockerCommandsDbContext context, ILoggerFactory loggerFactory)
 {
     _context = context;
     _logger  = loggerFactory.CreateLogger("DockerCommandsRepository");
 }