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