Esempio n. 1
0
        public async Task <WeatherModel> GetWeather()
        {
            Access.CheckRole("Admin");

            var weatherType = await WeatherServer.GetWeather();

            return(new WeatherModel
            {
                Date = DateTime.UtcNow,
                WeatherType = weatherType
            });
        }
Esempio n. 2
0
        public async Task Handle(SetWeatherCommand command)
        {
            Access.CheckRole("Admin");

            await WeatherServer.SetWeather(command.WeatherType);
        }