public async Task <ActionResult> PostLightControllerRemove([FromForm] LightControllerDto lightControllerDto) { var dbLights = _db.GetCollection <LightControllerEntity>(); dbLights.DeleteMany(_ => _.Hostname == lightControllerDto.Hostname); return(new ViewComponentResult() { ViewComponentName = SettingsViewComponent.Name }); }
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 }); }