Yes you can, but you must apply the same attributes as the generated linq2sql property ie
[Association(Name="Test_TestData", Storage="_TestDatas", ThisKey="SomeId", OtherKey="OtherId")] public System.Data.Linq.EntitySet<TestData> MyTestDatas { get { return this.TestDatas; } }
TestDatas is the original relation.
Update: A sample request that I executed:
var context = new DataClasses1DataContext(); var tests = from d in context.Tests where d.MyTestDatas.Any(md=>md.MyId == 2) select new { SomeId = d.SomeId, SomeData = d.SomeData, Tests = d.MyTestDatas }; foreach (var test in tests) { var data = test.Tests.ToList(); }
eglasius
source share