コード例 #1
0
        public async Task <ActionResult> PostLightControllerRemove([FromForm] LightControllerDto lightControllerDto)
        {
            var dbLights = _db.GetCollection <LightControllerEntity>();

            dbLights.DeleteMany(_ => _.Hostname == lightControllerDto.Hostname);

            return(new ViewComponentResult()
            {
                ViewComponentName = SettingsViewComponent.Name
            });
        }
コード例 #2
0
        public async Task <ActionResult> PostLightControllerAdd([FromForm] LightControllerDto lightControllerDto)
        {
            var dbLights = _db.GetCollection <LightControllerEntity>();

            dbLights.Insert(new LightControllerEntity {
                Hostname = lightControllerDto.Hostname
            });

            return(new ViewComponentResult()
            {
                ViewComponentName = SettingsViewComponent.Name
            });
        }