I want to use a stored procedure with join in Entity Framework Core 5. I have created the stored procedure using code-first migration.
How can I retrieve data from non-entity type that the stored procedure returns, and then display in view?
I want to use a stored procedure with join in Entity Framework Core 5. I have created the stored procedure using code-first migration.
How can I retrieve data from non-entity type that the stored procedure returns, and then display in view?
[HttpPost]
public async Task<ActionResult<IEnumerable<output>>> Getoutput(Input input)
{
string StoredProc = "exec YourStoreProcedure " +
"@Id= '" + input.Id+ "'";
return await _context.output.FromSqlRaw(StoredProc).ToListAsync();
}