public ActionResult Search(int zip) { var result = new SearchModel(); using (var data = new WeatherDBContext()) { var query = from wf in data.Weathers where wf.ZIPCODE == zip select wf; int count = 0; foreach (var q in query) { count++; result.id = q.ID; result.zipcode = q.ZIPCODE; result.location = q.LOCATION; result.forecast = q.FORECAST; result.temperature = q.TEMPERATURE; } if (count == 0) { return(new EmptyResult()); } } return(View(result)); }
public void PostRequestHandlerExecute(object sender, EventArgs e) { try { WeatherDBContext.TryDisposeCurrentHttpContext(); } finally { } }
public WeatherMeasureRepository(WeatherDBContext dbContext) { _dbContext = dbContext; }
public WeatherService() { db = new WeatherDBContext(); exelParseService = new ExelParseService(); }
public CityRepository(WeatherDBContext dbContext) { _dbContext = dbContext; }
public UserRepository(WeatherDBContext dbContext) { _dbContext = dbContext; }
public WeatherDataAccessLayer(WeatherDBContext context, IMapper mapper) { DBCtx = context; this.mapper = mapper; }
public static IWeatherDataAccessLayer GetInstance() { return(new WeatherDataAccessLayer(WeatherDBContext.GetInstance(), AutomapperConfiguration.Configure().CreateMapper())); }