What is alternative to yield of laravel blade in asp.net razor

Asp.net razor equivalent to yield in laravel blade template // This is one modal of specifying a section in the content @Section mainHeader { } // This is another model, in this way the section is made as mandatory. @RenderSection(“mainHeader”) // Optional rendering of a section is below @RenderSection(“mainHeader”, required: false)

Continue reading


How to search by Date Range in Entity Framework

Date Range in Entity Framework If we want to search entity with date range, assume we are passing StartDate, and EndDate as Request.Params, in MM/dd/yyyy format. public ActionResult Search() { var StartDate = Request.Params[“StartDate”]; var EndDate = Request.Params[“EndDate”]; var visits = visitBAL.GetVisits(); if (StartDate != null && !StartDate.Equals(“”)) { visits = visits.Where(v => v.DateStart >= […]

Continue reading


Difference between Configuration.cs vs Database Initializer in Entity Framework

Difference between Configuration.cs vs Database Initializer in Entity Framework Configuration.cs file located inside Migrations folder, which will be created when we execute the command “Enable-Migrations” in Package Manager Console. We can make use of this class for seeding the datas into database. This class will seed the database whenever we execute the Update-Database command in […]

Continue reading