: . , LinqToSql .
from c in dc.Customer
where c.Address.StreetName.StartsWith("AB")
select new Person() {Name = c.Name};
A (, ) :
- sql
DataContext.ExecuteQuery<Person>() sql documetation- sql datareader.
- datareader
DataContext.Translate<Person>() docmentation.
Customer.Name, . : datareader, DataContext.Translate<T> .
, , DataContext:
public IQueryable<CustomType> CustomTypeTable
{
get
{
var query = this.Type1Table.Select(t1 => new CustomType{f1 = t1.f1 ... })
.Concat( this.Type2Table.Select(t2 => new CustomType{f1 => t2.f1 ... })
return query
}
}
... ObjectTracking DataContext - PrimaryKey. () . , 1 2 .