Skip to content

Releases: OpenRIAServices/OpenRiaServices

v4.4.0.3

11 Feb 19:28
Compare
Choose a tag to compare

This is a minor patch update to Open RIA Services 4.4.0.0 which fixes some code generation issues. Also there are some structural changes to the nuget packages.

Fixed bugs

  • #70 Entity Property Generation does not seem to take EdmScalarPropertyAttribute(IsNullable) into account
  • #67 DomainOperationException properties change after throw
  • #62 can't mix signed assemblies on the client with unsigned on the server
  • #60 OpenRiaServices.Silverlight 4.4.0.0 - compilation errors in generated code

Package Changes

Most OpenRiaServices.Silverlight.* packages has been changed to only include the corresponding OpenRiaServices.Client.* package which should be used insted.

v4.4.0 - Async API and many other improvements

11 Feb 19:25
Compare
Choose a tag to compare

Copied from codeplex so formatting etc can be a bit off

Whats new in this release

Here is a overview of what has changed in this release, more details can be found in the issues themselves and the corresponding pull requests.

Features

  • Issue #40 Task Async API on client (danneesset)
  • Issue #41 Allow Task-Async Query and Invoke on Server (danneesset)
  • Issue #31 Allow multiple invocations of custom methods (danneesset)
  • Issue #27 Support long queries (danneesset)
  • #17,#16,#34 Initial support for portable class libraries (ColinBlair, danneesset)
  • Issue #43 Allow testing submit with multiple Changes (danneesset)
  • Issue #57 Implement ICollection interfaces for EntityCollection and EntitySet (danneesset)
  • Issue #44 Provide signed assemblies (ColinBlair)

Bug fixes

  • #9? Fix client properties being wiped (koimad)
  • #18 Code first concurrency token fields are incorrectly decorated with required attributes (ColinBlair)

Details

Provide signed assemblies #44

There are now signed versions of all nuget packages availible.
The signed packages starts with "OpenRiaServices.Signed" in the name, e.g the signed version of OpenRiaServices.Client.Core is named OpenRiaServices.Signed.Client.Core.

Task Async API on client #40

The following methods have been added to DomainContext:

Task<LoadResult<T>> DomainContext.LoadAsync<T>(...)
Task<SubmitResult> DomainContext.SubmitChangesAsync<T>()
Task<InvokeResult<T>> DomainContext.InvokeOperationAsync<T>(...)

Changes to DomainOperationException

  • DomainOperationException has been extended to include additional information such as Validation Errors.
  • SubmitOperationException - a new exception deriving from DomainOperationException and adds additional submit specific error information

Summary of new Types:

  • LoadResult - similar to LoadOperation, but represents the result of a successfully completed load
  • SubmitResult - similar to SubmitOperation, but represents the result of a successfully completed load
  • InvokeResult - similar to InvokeOperation, but represents the result of a successfully completed load
  • SubmitOperationException - a new exception deriving from DomainOperationException and adds additional submit specific error information

other chages:

  • Code generation (both standard and T4 generation) has been updated to generate a new Task-Async method for each invoke method

For a full description of what is implementation please read the posts in the async interface Group:
(http://www.openriaservices.net/MonoX/Pages/SocialNetworking/Groups/dboard/CsFyj7nODU6pBKIRAXZInw/Async-RIA-Services/?GroupId=qreTR9FatkG7V6IRAXX9MQ)

Allow Task-Async Query and Invoke on Server #41

Adds support for writing Queries and Invoke methods returning Task on the server.
Writing service methods which in turn use many task-async methods becomes easier since one can now use async/await in the service methods and return a Task.

It is Important: to understand that currently the requests are invoked and waited upon from within DomainService.Invoke and DomainService.Query.
In future releases one should not assume or rely on that either any of these methods will be invoked for Task-async server methods, instead we should look into adding async versions of these methods in order to achive better scalability. (The current Invoke and Query methods will continue to be invoked for non-Task methods).

  • Task GetSingleEntityQuery()
  • Task<IEnumerable>GetEnumerableEntityQuery()
  • Task<IQueryable>GetEntityQuery()
  • Task InvokeWithoutResult()
  • Task InvokeWithResult()

Allow multiple invocations of custom methods #31

It is now possible to invoke several different "custom methods"/"entity actions"
A new Attribute EntityActionAttribute has been added. The attribute "replaces" [Update(IsCustomMethod=true)] (the "IsCustomMethod=true" approach is still fully supported, but all new code should use [EntityAction] instead.
Each entity action can by default be invoked at most once for each SubmitChange call, but it now also possible to allow the same entity action to be invoked multiple times in the same changeset by setting "AllowMultipleInvocations=true" on the

[EntityAction] 
void Checkout(Order order);

[EntityAction(AllowMultipleInvocations)] 
void ReedeemCoupon(Order order, string coupon);

Support long queries #27

If EntityQuery part of a Query results in a to long URI then the Load call is automatically converted into a POST so the Query can be sent.

Allow testing submit with multiple changes #43

Add Submit and TrySubmit methods taking in a ChangeSet to DomainServiceTestHost in order to make it possible to test scenarios where the client submit multiple Changes at once.

Adds the following methods to DomainServiceTestHost:

  • public void Submit(ChangeSet changeSet);
  • public bool TrySubmit(ChangeSet changeSet);
  • public bool TrySubmit(ChangeSet changeSet, out IList validationErrors);

This makes it possible to write code like the following:

int changeId = 0;
var changeSet = new ChangeSet(new [] {
   new ChangeSetEntry(changeId++, entity1, null, DomainOperation.Insert),
   new ChangeSetEntry(changeId++, entity2 null, DomainOperation.Insert)
});

// Use submit if you expect the operation to succeed
domainServiceTestHost.Submit(changeSet);

// or use TrySubmit and check validation errors
IList<ValidationResult> validationErrors;
Assert.IsFalse(domainServiceTestHost.TrySubmit(changeSet, out validationErrors), "submit should fail");
Assert.AreEqual(1, validationErrors.Count);
Assert.AreEqual("expected validation error", validationErrors[0].ErrorMessage);