示例#1
0
        //Sets season to autumn.
        public void SetAutumnSeason()
        {
            WeatherView autumnStartDate = GetAutumnStartDate();

            if (autumnStartDate != default)
            {
                db.WeatherViewData
                .Where(d => d.Date.Date >= autumnStartDate.Date)
                .ToList()
                .ForEach(v => v.Season = "Höst");
                db.SaveChanges();
            }
        }
示例#2
0
        //Sets season to winter.
        public void SetWinterSeason()
        {
            WeatherView winterStartDate = GetWinterStartDate();

            if (winterStartDate != default)
            {
                db.WeatherViewData
                .Where(d => d.Date.Date > winterStartDate.Date)
                .ToList()
                .ForEach(v => v.Season = "Vinter");
                db.SaveChanges();
            }
        }
示例#3
0
        //Set season to summer.
        public void SetSummerSeason()
        {
            WeatherView summerStartDate = GetSummerStartDate();

            if (summerStartDate != default)
            {
                db.WeatherViewData
                .Where(d => d.Date.Date >= summerStartDate.Date)
                .ToList()
                .ForEach(v => v.Season = "Sommar");
                db.SaveChanges();
            }
        }
示例#4
0
 //Get stats for one date.
 public WeatherView GetStatFromDate(WeatherView view)
 {
     if (view == null)
     {
         return(default);