public WeatherApi weather_thread(string city) { var myWeatherTask = getWeather(city); myWeatherTask.Wait(); WeatherApi myWeather = myWeatherTask.Result; string dataTime = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); var contextOptions = new DbContextOptionsBuilder <WebApplication3Context>() .UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=WebApplication3Context-6c28e34d-e6cb-4189-9bb9-60ff82f2a08f;Trusted_Connection=True;MultipleActiveResultSets=true") .Options; var context = new WebApplication3Context(contextOptions); var weath = new Models.weather(); weath.name = myWeather.name; weath.temp = Math.Round(myWeather.main.temp - 273.15, 1); weath.datatime = dataTime; weath.description = myWeather.weather[0].description; context.Add(weath); context.SaveChanges(); return(myWeather); }
public MensagemController(WebApplication3Context context) { _context = context; }
public CategoriesController(WebApplication3Context context) { _context = context; }
public TagsController(WebApplication3Context context, IDataRepository <Tags> dataRepository) { _context = context; _repo = dataRepository; }
public ComentariosController(WebApplication3Context context) { _context = context; }
public TeamsController(WebApplication3Context context) { _context = context; }
public PostsController(WebApplication3Context context, IDataRepository <BlogPost> repo) { _context = context; _repo = repo; }
public ContractsController(WebApplication3Context context) { _context = context; }
public StudentsController(WebApplication3Context context) { _context = context; }
public PlayersController(WebApplication3Context context) { _context = context; }
public UsersController(WebApplication3Context context, IStringLocalizer <UsersController> localizer) { _context = context; _localizer = localizer; }
public ImagesController(WebApplication3Context context, IWebHostEnvironment hostEnvironment) { _context = context; this._hostEnvironment = hostEnvironment; }
public MyTablesController(WebApplication3Context context) { _context = context; }