entities query in
int[] ids = { 1, 2, 3, 4, 5};
var query = from item in db.myTable
where ids.Contains(item.ID)
select item;
entities query in
int[] ids = { 1, 2, 3, 4, 5};
var query = from item in db.myTable
where ids.Contains(item.ID)
select item;
entity framework with query c#
using (var ctx = new SchoolDBEntities())
{
var studentName = ctx.Students.SqlQuery("Select studentid, studentname, standardId from Student where studentname='Bill'").FirstOrDefault<Student>();
}
//Reference Link
//https://www.entityframeworktutorial.net/Querying-with-EDM.aspx
entity framework with query C#
using (var ctx = new SchoolDBEntities())
{
var studentName = ctx.Students.SqlQuery("Select studentid, studentname, standardId from Student where studentname='Bill'").FirstOrDefault<Student>();
}
//https://www.entityframeworktutorial.net/Querying-with-EDM.aspx
//https://www.entityframeworktutorial.net/EntityFramework4.3/raw-sql-query-in-entity-framework.aspx
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us