http://diwakarko.blogspot.com (दिवाकरको ब्लग)

FirstOrDefault Value by Linq

No comments
model = from b in db.books.Take(6).ToList()
       where b.writerId==id
       select b;

var wtrName = model.FirstOrDefault().writer.WriterName;
ViewBag.title = "Book List of Writer : " + wtrName;

No comments :

Post a Comment