Restier RC1
Pre-releaseTHE LONG-AWAITED RELEASE CANDIDATE IS HERE!
The team has been working hard these past 9 months to give you the best product possible. Leading up to this release, Restier services are powering US State agencies, restaurants, and startups around the globe. It has been thoroughly tested and is ready for you to build innovative apps.
Release Notes
Reporting Problems
If you encounter any problems, please open a new Issue and label it "rc1".
A Note on .NET Core Support
We know .NET Core is important, and Version 2 will be rebuilt from the ground up to support .NET Core 3.0. We expect that release to happen sometime in H1 2020.
In the meantime, the recommended approach is to separate your APIs into an ASP.NET Classic WebApi app on .NET Framework 4.7.2, and leverage Entity Framework 6.3 (which can be used on both .NET Framework AND .NET Core) for your entities. This way, your front-end can still be ASP.NET Core, even if the APIs can't.
We know this is not ideal and as community members actively shipping Restier-powered .NET Core apps, we feel your pain. But it is a battle-tested approach that works very well.
New Features
- Dependency Injection has been significantly refactored to properly implement Constructor injection wherever possible.
- We've split Restier registration to feel more like .NET Core. Services are now registered at startup, and no longer have to rely on implementing a ConfigureApi override in your API classes.
- We've decoupled the EF provider from ASP.NET Classic, so you can build CQRS APIs in Restier without unnecessary dependencies.
- NOTE:
Microsoft.Restier.AspNet
's NuGet package dependency onMicrosoft.Restier.EntityFramework
will be removed in the next release.
- NOTE:
- Route mapping now registers a
RestierBatchHandler
for you by default. - You can now correctly specify whether detailed stack traces (cleaned up through Ben.Demystifier) are returned when an exception is thrown. See this example for more details.
- You can now throw a
StatusCodeException
to return specific HTTP Status codes and error messages to the API consumer. See this example for more details.
Dependency Changes
- Compatible with .NET Framework 4.6.2 and later. (Recommend version 4.7.2 for Azure AppService support)
- Compatible with
Microsoft.Extensions.DependencyInjection
version 2.2 and later. (Recommend version 3.0) - Compatible with
Microsoft.OData.Core
version 7.6.0 and later. - Compatible with
EntityFramework
version 6.1.3 and later (recommend version 6.3) - Compatible with
Microsoft.AspNet.OData
version 7.2.1 and later. - Compatible with
Microsoft.AspNet.WebApi
version 5.2.7 and later.
API Changes
- The entire framework has been massively refactored:
- Projects have been converted to the new SDK-style projects.
- Project names and package names have been simplified, and in come cases, reverted to earlier incarnations.
- Namespacing has been simplified.
- Base implementations have been prefixed with "Default" more consistently, to make it easier to differentiate implementations in providers and unit tests.
- Entity-Framework specific interface implementations (classes that implement
IModelMapper
orIModelProducer
, for example) have been prefixed with "EF" (EFModelMapper
,EFModelProducer
, etc) to reduce ambiguity. IServiceCollection.AddService()
methods have been renamed toIServiceCollection.AddChainedService()
to better explain what is happening under the covers. If you need an unchained service, use the defaultIServiceCollection.AddSingleton()
orIServiceCollection.AddScoped()
methods.config.MapRestierRoute()
has been changed toconfig.MapRestier()
and has simplified the parameters.- Pluralization of Convention-Based methods has been fixed. Filters now use the plural form of your objects, and Insert/Update/Delete interceptors now use the singular form.
- Unnecessary exception types have been eliminated.
Upgrade Instructions
- Move services previously registered under
EntityFrameworkApi.ConfigureApi()
in your Restier API toconfig.UseRestier()
in your WebApiConfig. See this example for more details. - If you are building an API based on an Entity Framework
DbContext
, register for the EF6 Provider inconfig.UseRestier()
. See this example for more details. - Change your
config.MapRestierRoute()
toconfig.MapRestier()
. See this example for more details. - Change your
[Operation]
attributes to specify anOperationType
instead of usingHasSideEffects
. The compiler warning gives you information on how to fix it, see this example for more details. - Fix the pluralization of your Interceptors. See this example for more details.
- Breakdance.Restier can generate a VisibilityMatrix that shows you the method names Restier expects based on your model. See this example for more details.