Here are the examples of the csharp api System.Threading.Tasks.Task.FromResult(WeatherForecast) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
Source : WeatherService.cs
with MIT License
from Macross-Software
with MIT License
from Macross-Software
public Task<WeatherForecast?> GetWeatherForecase(int postalCode)
{
WeatherForecast? Forecast = postalCode <= 0
? null
: new WeatherForecast
{
PostalCode = postalCode,
FriendlyName = "Blanchtown",
HighTemperatureInFahrenheitDegrees = 70,
LowTemperatureInFahrenheitDegrees = 50,
ForecastGoodUntilTime = DateTime.Now.AddSeconds(30)
};
_Logger.WriteInfo(Forecast, "Weather forecast generated.");
return Task.FromResult(Forecast);
}