I was using entity framework 6 in my asp.net application and using raw queries like following:
string studentName = ctx.Database.SqlQuery<string>(
"Select studentname from Student where studentid=1").FirstOrDefault();
Now I am moving my application to asp.net core, but I could not found raw sql query without using DbSet type.
var students = context.Students
.FromSql("Select * from Students where Name = 'Bill'")
.ToList();
But this does not solve my solutions.
Is there any extension that developed to run sql queries?
context.Students.Where(s=>s.Id=1).Select(s=>s.Name).Take(1)