MicroLite.Extensions.WebApi 6.6.0

The OData query parsing library which was spun out of the MicroLite WebApi extension has undergone quite a few changes and some of those have been incorporated into the MicroLite WebApi extension.

The main difference is that the OData query support has been split out into a separate library so if you want to use WebApi controllers but don’t use OData, you no longer have a dependency on the Net.Http.WebApi.OData library. Starting with version 6.6.0 of the MicroLite WebApi extension, there are now 2 packages available:

What do I need to do?

“I use the WebApi extension and want OData 4.0!”

  1. PM> Install-Package MicroLite.Extensions.WebApi.OData -Version 6.6.0

“I use the WebApi extension and don’t use OData query support”

  1. PM> Install-Package MicroLite.Extensions.WebApi -Version 6.6.0
  2. PM> Uninstall-Package Net.Http.WebApi.OData

Query Option Changes
$inlinecount=allpages has been replaced by $count=true.

The JSON response for paged results ($count=true) has changed as follows:

  1. data.__count is now data['@odata.count']
  2. data.results is now data.value

Function Changes
The substringof function has been replaced by contains in the $filter query option so substringof('Alfreds', CompanyName) would become contains(CompanyName, 'Alfreds')

Data Type Changes:
The DateTime type has been removed, there is a new Date type for dates only which is a literal and doesn’t need a type prefix or quotes $filter=DateOfBirth eq 1974-08-19. To specify date and time, use DateTimeOffset literal instead which also no longer requires a type prefix or quotes $filter=Created gt 2002-10-15T17:34:23Z don’t forget the timezone!.

The Guid type no longer requires a prefix or quotes TransactionId eq guid'0D01B09B-38CD-4C53-AA04-181371087A00' becomes TransactionId eq 0D01B09B-38CD-4C53-AA04-181371087A00

The library now requires the entity model to be defined, see the Wiki for further details.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s