public Models.BusinessCardDisplay Post([FromBody] Models.BusinessCardDisplay BusinessCardDisplay) { if (ModelState.IsValid && BusinessCardDisplay.ModuleId == _entityId) { BusinessCardDisplay = _BusinessCardDisplayRepository.AddBusinessCardDisplay(BusinessCardDisplay); _logger.Log(LogLevel.Information, this, LogFunction.Create, "BusinessCardDisplay Added {BusinessCardDisplay}", BusinessCardDisplay); } return(BusinessCardDisplay); }
public void ImportModule(Module module, string content, string version) { List <Models.BusinessCardDisplay> BusinessCardDisplays = null; if (!string.IsNullOrEmpty(content)) { BusinessCardDisplays = JsonSerializer.Deserialize <List <Models.BusinessCardDisplay> >(content); } if (BusinessCardDisplays != null) { foreach (var BusinessCardDisplay in BusinessCardDisplays) { _BusinessCardDisplayRepository.AddBusinessCardDisplay(new Models.BusinessCardDisplay { ModuleId = module.ModuleId, Name = BusinessCardDisplay.Name }); } } }