Esempio n. 1
0
        static void Main(string[] args)
        {
            var container = new Model1Container();

            var person = new Person()
                {
                    Name = "aaa",
                    Age=12
                };
            container.People.AddObject(person);
            container.SaveChanges();

            Expression<Func<Person, bool>> expression2 = p => p.Age==12;
            Expression<Func<Person, bool>> expression = p => A(p);
            Expression<Func<Person, bool>> expression3 = p => p.Name=="aaa";
            var query=container.People.Where(expression2).Where(expression3);
            var q =  (ObjectQuery<Person>)query;
            var str = q.ToTraceString();
            var list = query.ToList();
            var b = 0;
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the People EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPeople(Person person)
 {
     base.AddObject("People", person);
 }
Esempio n. 3
0
 private static bool A(Person p)
 {
     return p.Age == 12;
 }
 /// <summary>
 /// Create a new Person object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Person CreatePerson(global::System.Int32 id)
 {
     Person person = new Person();
     person.Id = id;
     return person;
 }