public override IQueryable <ContactInformation> SearchData(string name) { this.RouteData.Values["PageIndex"] = 1; ViewData["TPage"] = 1; var itemParameter = Expression.Parameter(typeof(ContactInformation), "item"); var whereExpression = Expression.Lambda <Func <ContactInformation, bool> > ( Expression.Equal ( Expression.Property ( itemParameter, "CompanyName" ), Expression.Constant(name) ), new[] { itemParameter } ); return(db.GetTable <ContactInformation>().Where(whereExpression)); }
public void Add(T item) { db.GetTable <T>().InsertOnSubmit(item); Save(); }