コード例 #1
0
        private static void Populate(SqliteResourceDataService <WeatherForecastV1> service)
        {
            var model = new WeatherForecastV1
            {
                Id           = StableId,
                Date         = DateTime.Now,
                Summary      = "Chilly",
                TemperatureC = 0
            };

            Assert.True(service.TryAdd(model, out _, CancellationToken.None));
        }
        public override void Populate(SqliteResourceDataService <WeatherForecastV1> service)
        {
            Assert.True(service.TryAdd(new WeatherForecastV1
            {
                Id           = IdGreaterThanInsertedFirst,
                Date         = DateTime.Now,
                Summary      = "Chilly",
                TemperatureC = 0
            }, out _, CancellationToken.None));

            Assert.True(service.TryAdd(new WeatherForecastV1
            {
                Id           = IdLessThanInsertedSecond,
                Date         = DateTime.Now,
                Summary      = "Scorching",
                TemperatureC = 100
            }, out _, CancellationToken.None));
        }