ASP.NET Hosting

ASP.NET Tutorial: How to Use the DBFirst Approach in Entity Framework to Connect Databases

An alternative to the Code First and Model First methods to the Entity Data Model is the Database First Approach, which builds model codes (classes, properties, DbContext, etc.) from the project’s database and uses those classes as the bridge between the controller and database.

As there are a lot of fundamentals covered in “Code First Approach in Entity Framework”(), which is why we named it “Code First,” I’ll advise you to read the “Code First” article. Initially, we create model codes (classes, properties, and DbContext), and these model classes then create a database for us at run time.

public interface IDashboardRepository
{
    Task<IActionResult> GetBarChartDashboard(int d, int m, int y, int w);

    Task<IActionResult> GetMonthFilterData();
    Task<IActionResult> GetWeekFilterData();

}

 public DbSet<ApiEndPoint> ApiEndPoint { get; set; }

Dashboard Repository

public async Task<IActionResult> GetBarChartDashboard(int d, int m, int y, int w)
{
    try
    {
        List<ApiEndPoint> list;
        var dbContext = await dbContextProvider.GetDbContextAsync();
        string sql = "spGetDashboardData {0}, {1}, {2}, {3}";

        list = dbContext.ApiEndPoint.FromSqlRaw<ApiEndPoint>(sql, d, m, y, w).ToList();

        //var populationList = PopulationDataAccessaLayer.GetUsStatePopulationList();
        return new OkObjectResult(list);
    }
    catch (Exception)
    {
        throw;
    }
}

ASP.NET Core 8 Hosting Recommendation

HostForLIFE.eu
HostForLIFE.eu is a popular recommendation that offers various hosting choices. Starting from shared hosting to dedicated servers, you will find options fit for beginners and popular websites. It offers various hosting choices if you want to scale up. Also, you get flexible billing plans where you can choose to purchase a subscription even for one or six months.