Release notes for re-motion version 1.13.63

List of Issues

Bugfixes

New Features

Details

[COMMONS-2801] Ctor of StreamedSequenceInfo should throw an exception if dataType parameter is not an implementation of IEnumerable<T>

Component/s: Data.Linq
Issue Type: Bug
Resolution: Fixed
Status: Closed


(no description)

[COMMONS-2800] re-store throws exception if a LINQ query returns DomainObjects but casts them to an interface

Component/s: Data.Linq
Issue Type: Bug
Resolution: Fixed
Status: Closed


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();
      }
    }

[COMMONS-2810] re-linq support for ASP.NET partial (medium) trust

Component/s: Data.Linq
Issue Type: New Feature
Resolution: Fixed
Status: Closed


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.

[COMMONS-2712] Support nested select projections in subqueries

Component/s: Data.Linq
Issue Type: New Feature
Resolution: Fixed
Status: Closed


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.

[COMMONS-2711] Support paging via Skip and Take result operators

Component/s: Data.Linq
Issue Type: New Feature
Resolution: Fixed
Status: Closed


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.

[COMMONS-2594] Support for explicit joins with an "into" clause

Component/s: Data.Linq
Issue Type: New Feature
Resolution: Fixed
Status: Closed


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

  • A join using "into" is not directly translated into SQL unless the sequence variable is actually used.
  • The sequence variable can be used in a from clause: join ... into cooks ... from c in cooks. In that case, the SQL produced is equivalent to that of a where-style inner join (from c in Cooks where k == c.Kitchen).
  • A usage of the sequence variable with a result operator such as Count() is equivalent to using a from clause selecting from that sequence variable.
  • The sequence variable can not be used anywhere a value is required, including select projections (unless as a subquery).
  • The sequence variable can be combined with the DefaultIfEmpty() result operator. In that case, the join semantics changes from inner join semantics to left outer join semantics.