using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ForumMVC; using System.Data.Entity; using ForumMVC.Models; namespace ForumMVC.Controllers { public class HomeController : Controller { forumEntities1 db = new forumEntities1(); public ActionResult Index() { IList<CUSTOMER> data = (from s in db.CUSTOMER let lowercaseCustomerName = s.CUST_NAME.ToLower() where lowercaseCustomerName.EndsWith("singh") select s).ToList(); return View(data); }
} }
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The 'let' keyword is useful in query syntax. It allows re-use of the expression and makes the query more readable.