public void FromSqlCe_Manual()
 {
     var stopwatch = Stopwatch.StartNew();
     var count = 0;
     using (var reader = GetSqlDataReader())
     {
         while (reader.Read() && count < PerformanceIterations)
         {
             count++;
             var user = new User();
             user.Id = (Guid)reader["UserId"];
             user.FirstName = (string)reader["FirstName"];
             user.LastName = (string)reader["LastName"];
             var address = new Address();
             address.Line1 = (string)reader["Line1"];
             address.Line2 = (string)reader["Line2"];
             address.PostCode = new PostCode();
             address.PostCode.Code = (string)reader["PostCode"];
             user.Address = address;
             AssertUser(reader, user, true, true);
         }
     }
     Debug.WriteLine("FromSqlCe_Manual -Mapped: {0} objects and asserted 0 failures in: {1}ms", count, stopwatch.ElapsedMilliseconds);
 }
示例#2
0
 public User()
 {
     Address = new Address();
 }