Equivalent of Html.RenderAction in ASP.NET Core
I was finally able to do it with ViewComponent. So, instead of RenderAction(), I did: @section xyz{ @await Component.InvokeAsync(“abc”) } Where abc is a class as abcViewComponent. The ViewComponent looks like: public class abcViewComponent : ViewComponent { private DbContextOptions<MyContext> db = new DbContextOptions<MyContext>(); public async Task<IViewComponentResult> InvokeAsync() { MyContext context = new MyContext(db); IEnumerable<tableRowClass> mc … Read more