Q:

How to get a list of upcoming Events using EF & ASP.NET MVC

How to get data for upcoming events using Entity Framework and ASP.NET MVC? 
I want to show the list of the new events that are coming and if possible I want to hide the old ones that have passed. Below is my database table I am using for my calendar. 
 | EventID | Subject | Description     | Start      | End         | ThemeColour | Course      | IsFullDay 
 +---------+---------+-----------------+------------+-------------+-------------+--------
 | 1       | Work    | Teaching kids   | 24/02/2020 | 24/02/22020 | Blue        | English     | False
 | 2       | Work    | Teaching kid    | 15/01/2020 | 15/01/2020  | Blue        | Maths       | False 
 | 3       | Work    | Teaching Kids   | 19/06/2019 | 19/06/2019  | Green       | Maths       | False 

A:

You need to setup a DbContext so that EF knows how to work with your database.
https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
When you have a DbContext you can write code like this
EventDbContext database = new EventDbContext();
var query = database.Events.Where(evt => evt.Start.Date >= DateTime.Now.Date);
var upcomingEvents = query.ToList();

Your DbContext might be called something else. EventDbContext is just an example. Also your table might not be called "Events" so change that also.

