Code snippet throws exception with new linq provider:
This query provider does not support the given query ('from BaseDataObjectConnection bdoc in DomainObjectQueryable<BaseDataObjectConnection> where ([bdoc].FileHandlingObject.ID = File|00000053-0000-0000-0000-000000000003|System.Guid) select [bdoc] => Cast<ActaNova.Domain.IClassifiedLink>()'). re-store only supports queries selecting a scalar value, a single DomainObject, or a collection of DomainObjects.
With old linq provider this code worked.
private static ICollection<IClassifiedLink> GetAllDirektLinks(FileHandlingObject sourceObject) { using (new SecurityFreeSection ()) { var bdos = QueryFactory.CreateLinqQuery<BaseDataObjectConnection>().Where (bdoc => bdoc.FileHandlingObject.ID == sourceObject.ID); return bdos.Cast<IClassifiedLink>().ToList(); } }
re-linq now supports partial trust scenarios.
It does not fully support ASP.NET medium trust because some features (e.g., the possibility to access a local variable or anonymous type in a LINQ expression) require reflection access to non-public members, and ASP.NET medium trust does not allow such access. Note that by default, the C# compiler automatically creates anonymous types for joins and multiple from clauses, so such queries will fail under medium trust.
To use all re-linq features in such environments, ReflectionPermission with the MemberAccess flag must be granted in addition to the default medium trust permissions.
Support queries of the following form: from c in Cooks from assistant in (from a in c.Assistants select new { Age = a.Age, Name = a.FirstName }) where assistant.Age > 18 select assistant.Name }).
Note that only anonymous types are supported.
Full support for nested projections on the top level is a separate feature.
Support queries of the form: Cooks.Skip (10).Take (20), which takes 20 items starting from the 10th one.
The generated query uses the ROWNUMBER function and adds an ORDER BY clause if none is specified.
Support queries of the following forms: from k in Kitchens join c in Cooks on k equals c.Kitchen into cooks select cooks.Count(), from k in Kitchens join c in Cooks on k equals c.Kitchen into cooks from c in cooks select c, from k in Kitchens join c in Cooks on k equals c.Kitchen into cooks from c in cooks.DefaultIfEmpty() select c