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