Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public void Add(T item)
 {
     db.GetTable <T>().InsertOnSubmit(item);
     Save();
 }