public ActionResult List() { using (var db = new XkSystem.Models.DbContext()) { var vm = new Models.Tenant.List(); var tb = from p in db.TableRoot <Admin.Entity.tbTenant>() select p; if (string.IsNullOrEmpty(vm.SearchText) == false) { tb = tb.Where(d => d.TenantName.Contains(vm.SearchText)); } vm.TenantList = (from p in tb orderby p.TenantName select p).ToList(); return(View(vm)); } }
public ActionResult List(Models.Tenant.List vm) { return(Code.MvcHelper.Post(null, Url.Action("List", new { searchText = vm.SearchText }))); }