Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
                }
            }
        }