public async Task ExecuteAsync() { string url = @"http:\\localhost:8088"; await using var context = new KSqlDBContext(url); var http = new HttpClientFactory(new Uri(url)); restApiClient = new KSqlDbRestApiClient(http); await CreateOrReplaceStreamAsync(); var statement = context.CreateOrReplaceTableStatement(MaterializedViewName) .As <IoTSensor>(StreamName) .GroupBy(c => c.SensorId) .Select(c => new { SensorId = c.Key, AvgValue = c.Avg(g => g.Value) }); var response = await statement.ExecuteStatementAsync(); response = await InsertAsync(new IoTSensor { SensorId = "sensor-1", Value = 11 }); }