public new WeatherForecast Insert(CreateWeatherDto newItem)
        {
            var item = base.Insert(newItem);

            sourceCache.AddOrUpdate(item);
            return(item);
        }
Exemple #2
0
        public WeatherForecast Insert(CreateWeatherDto newItem)
        {
            var item = new WeatherForecast
            {
                Id           = Guid.NewGuid(),
                Date         = newItem.Date,
                Summary      = newItem.Summary,
                Region       = newItem.Region,
                TemperatureC = newItem.TemperatureC
            };

            logger?.LogInformation("Insert DB id:{0}", item.Id);
            items.Add(item);
            return(item);
        }
Exemple #3
0
 public WeatherForecast InsertSingle(
     [FromBody] CreateWeatherDto newItemDto)
 {
     return(repository.Insert(newItemDto));
 }