Esempio n. 1
0
 public Command CreateCommand(Command command)
 {
     if (command != null)
     {
         throw new ArgumentNullException(nameof(command));
     }
     commanderDBContext.Add(command);
     SaveChanges();
     return(command);
 }
Esempio n. 2
0
        public Command CreateCommandRepo(Command cmd)
        {
            _telemetryClient.TrackEvent("Logging - in CreateCommandRepo (Repository) | telemetry");
            _logger.LogInformation("Logging - in CreateCommandRepo (Repository) | serilog");
            var details    = _mapper.Mapper.Map <Command, TblCommand>(cmd);
            var addDetails = _commanderDBContext.Add(details).Entity;

            _commanderDBContext.SaveChanges();

            var response = _mapper.Mapper.Map <TblCommand, Command>(addDetails);

            return(response);
        }