﻿using System;
using System.Linq;

using LinqToDB;

using NUnit.Framework;

namespace Tests.UserTests
{
	[TestFixture]
	public class Issue1556Tests : TestBase
	{
		[Test]
		public void Issue1556Test([DataSources(ProviderName.Sybase, ProviderName.OracleNative)] string context)
		{
			using (var db = GetDataContext(context))
			{
				AreEqual(
					from p in db.Parent
					from c in db.Child
					where p.ParentID == c.ParentID || c.GrandChildren.Any(y => y.ParentID == p.ParentID)
					select new { p, c }
					,
					db.Parent
						.InnerJoin(db.Child,
							(p,c) => p.ParentID == c.ParentID || c.GrandChildren.Any(y => y.ParentID == p.ParentID),
							(p,c) => new { p, c }));
			}
		}
	}
}

﻿using System;
using System.Linq;

using LinqToDB;

using NUnit.Framework;

namespace Tests.UserTests
{
	[TestFixture]
	public class Issue1556Tests : TestBase
	{
		[Test]
		public void Issue1556Test(
			[DataSources(ProviderName.Sybase, ProviderName.OracleNative, ProviderName.Access)] string context)
		{
			using (var db = GetDataContext(context))
			{
				AreEqual(
					from p in db.Parent
					from c in db.Child
					where p.ParentID == c.ParentID || c.GrandChildren.Any(y => y.ParentID == p.ParentID)
					select new { p, c }
					,
					db.Parent
						.InnerJoin(db.Child,
							(p,c) => p.ParentID == c.ParentID || c.GrandChildren.Any(y => y.ParentID == p.ParentID),
							(p,c) => new { p, c }));
			}
		}
	}
}

Access dos not support such join syntax.
Access dos not support such join syntax.
