Esempio n. 1
0
 public Models.QRCodeGenerator Post([FromBody] Models.QRCodeGenerator QRCodeGenerator)
 {
     if (ModelState.IsValid && QRCodeGenerator.ModuleId == _entityId)
     {
         QRCodeGenerator = _QRCodeGeneratorRepository.AddQRCodeGenerator(QRCodeGenerator);
         _logger.Log(LogLevel.Information, this, LogFunction.Create, "QRCodeGenerator Added {QRCodeGenerator}", QRCodeGenerator);
     }
     return(QRCodeGenerator);
 }
        public void ImportModule(Module module, string content, string version)
        {
            List <Models.QRCodeGenerator> QRCodeGenerators = null;

            if (!string.IsNullOrEmpty(content))
            {
                QRCodeGenerators = JsonSerializer.Deserialize <List <Models.QRCodeGenerator> >(content);
            }
            if (QRCodeGenerators != null)
            {
                foreach (var QRCodeGenerator in QRCodeGenerators)
                {
                    _QRCodeGeneratorRepository.AddQRCodeGenerator(new Models.QRCodeGenerator {
                        ModuleId = module.ModuleId, Name = QRCodeGenerator.Name
                    });
                }
            }
        }