public async Task InsertDockerCommandAsync(DockerCommand command)
 {
     _context.DockerCommands.Add(command);
     try {
         await _context.SaveChangesAsync();
     }
     catch (Exception exp) {
         _logger.LogError($"Error in {nameof(InsertDockerCommandAsync)}: " + exp.Message);
     }
 }
        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);
            }

        }
예제 #3
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);
            }
        }