vNext OData port
Hello all,
Seeing as ASP.NET 5/ASP.NET Core/vNext/whatever-you-want-to-call-it is most certainly the future, will there be any concerted effort to continue the port? I see it was last touched 8 months ago. I have a fork that works with RC2, but it is still a very limited port (no $expand, $skip, $top, support for nested properties etc.).
Does anyone have any thoughts on this?
Many thanks
I'm really interested in this too! I tried it a few days ago and it was a bit painfull to get it working with a later release.
@joshcomley, the one in master is indeed 8 months ago - but in the vnext branch (not the folder) there is still some progress :)
+1
the odata library namespace should be renamed to Microsoft.AspCore.Odata aligning the namespace with the standardisation that has been selected for EF & MVC etc. which targets the Core CLR.
Hey I am sorry I didn't get notified of these messages! I have a branch that I maintain that I keep working up to date with the latest ASP.NET Core version. I am unsure whether I should bother with pull requests to this, or as it looks relatively abandoned simply start a new open source OData project with the implementation I've adapted from here as a base. Does anyone know if this is legal to do?
My branch can be found here: https://github.com/joshcomley/WebApi/
It is up to date with ASP.NET Core, and with the namespace change, too.
This also includes some support I've added for OData actions in the vNext implementation. Check my commit history for details of updates.
FYI I have a pull request to get my work (and @grahamehorner's original work that mine was based on) merged:
https://github.com/OData/WebApi/pull/611
Still no clue :( OData is not ported yet to ASPNET.Core
OData is dead?
It's open source. Microsoft has used it for Azure (e.g.) and I guess, they have no huge team on it.
No updates, no ecosystem, no contributes.
Sporadic equally spaced blog updates avoiding the elephant in the room. Vague mentions of reshuffling.
This is starting to feel like Silverlight all over again...
Please. Let us know what is going on, so we can inform concerned stakeholders.
Thanks for your feedback.
The VNext branch was an experimental branch for exploring a way to support .NET Core. Our direction for .NET Core support for WebAPI has gone a different direction, so we are no longer investing in the VNext branch.
We are actively investing in adding support for .NET Core to the WebAPI master branch in order to build standard and .NET core from the same repo. Sorry for the delay, this has turned into a huge work item.
Hi! Thanks to everyone for their patience. Yes, we will be releasing a version of OData WebApi that supports ASP.Net Core. We hope to have an alpha on NuGet in the next several weeks. After that, we’d like to get feedback before releasing an RTM version. If you are interested in help out, please let us know.
The current plan involves breaking changes. We want to release the ASP.Net Core version in a Microsoft namespace as opposed to the current System namespace. We decided to change the existing System namespace to a Microsoft namespace while leaving the existing APIs signature as-is. This does constitute a breaking change, albeit one we think is easy to accommodate. We’d love to get your feedback on this approach and its impact to you. If you have a different idea or just want to chime in with a pro or con, please let us know.
At a high level, the plan is to combine the code from the master branch (formerly OData60) and the maintenance-aspnetcore branch (formerly vNext) to create two version of OData WebApi from a common codebase: a ASP.Net WebApi 2 compatible version and an ASP.Net Core compatible version. Below, you’ll find some details on how we arrived at this plan. We plan to add a feature branch to the OData\WebApi repository and begin consolidating the changes there.
Feel free to chime in with thoughts and concerns regarding this plan on either this issue or a new GitHub issue. Again, thanks for your patience. – The OData Team.
We have examined the code in both the master branch (formerly OData60) and the maintenance-aspnetcore branch (formerly vNext) and created a design that supports both ASP.Net WebApi 2 and ASP.Net Core from a single code base. We found that the two branches share about 80% commonality and that the ASP.Net WebApi classes were intertwined with much of the common code. The design we landed on was to refactor the existing code into an ASP.Net WebApi 2-specific portion, which is tightly coupled to the ASP.Net WebApi 2-specific classes, and a common portion which has no dependency on ASP.Net. The code from maintenance-aspnetcore can then be refactored to consume the common portion and provide the ASP.Net Core-specific portion.
This design will allow us to ship both an ASP.Net WebApi 2 compatible version of OData WebApi, a.k.a. the recently release OData WebApi 6.0, for customers not interested in migrating to .Net core and an ASP.Net Core compatible version of OData WebApi for customers that do plan to migrate or build new services on ASP.Net Core. The common parts of the code can be maintained more easily for both versions which reduces the overall engineering maintenance cost. Additionally, we will be able to add new features to the ASP.Net WebApi 2 version, as well as the new ASP.Net Core version.
The design has been prototyped and mostly coded so we’re confident in the design. The next step is to begin reviewing and committing the code to refactor the existing library into two components. This will be created through a series of pull requests targeting a new feature branch. Once committed, we’ll create and publish a nightly Nuget package in MyGet.org for testing. From there, we’ll add the ASP.Net Core version and tests and publish a second nightly Nuget package in MyGet.org. The feature branch will ultimately be merged to master and we’ll ship both packages via Nuget.org.
One issue we ran into during prototyping was the best way to structure the common code. We considered packing the common code into a new Dll based on .NetStandard which can run on Net Framework 4.x as well as .Net Core. However, some of the APIs we needed would have caused a dependency on .NetStandard 1.5, which would force a dependency on .Net Framework 4.6.1 instead of 4.5. To avoid this, we decided to use a Shared Project, a VS 2015 feature that allows common code to be maintained in a single project and included in additional projects. As a result, we’re able to allow each version of the library to take a dependency on the appropriate version of .Net, which will require that the common code compiles for both frameworks and will likely use some conditional compilation, i.e. #if.
An additional issue is that we want to release the ASP.Net Core version in a Microsoft namespace as opposed to the current System namespace. The compiler does not offer a way to compile the same code in two namespaces and we didn’t like the idea of conditional compilation for the namespace. We decided to change the existing System namespace to a Microsoft namespace while leaving the existing APIs signature as-is. We have validated that only changing the using statements in the End to End tests results in a project that compiles and runs. This does constitute a breaking change, albeit one we think is easy to accommodate. We’d love to get your feedback on this approach and its impact to you. If you have a different idea or just want to chime in with a pro or con, please let us know.
The last hurdle we faced was a build system that can build and release the ASP.Net Core version of OData WebApi. .Net Core is only officially supported on VS2017 so we’ll need to not only require VS2017 for development but also lab builds that produce our Nuget packages. We’ve spent the last few months upgrading our engineering system to eliminate this hurdle. The first part of the refactor will target VS2015; VS2017 will be added as we introduce the ASP.Net Core portion.
The AspNetCore alpha package is available here: https://www.myget.org/F/webapinetcore/
Feel free to file issues but please mark them as AspNetCore, either with [feature//netcore] in the title (like #1134) or by applying the feature/netcore label.
There is no docs or samples yet, here is an example Startup class:
public class Startup
{
public Startup() {}
public void ConfigureServices(IServiceCollection services)
{
services.AddOData();
services.AddSingleton<SampleContext>();
}
public void Configure(IApplicationBuilder app)
{
IEdmModel model = GetEdmModel(app.ApplicationServices);
app.UseMvc(routeBuilder => routeBuilder.MapODataServiceRoute("name", "prefix", model));
}
private static IEdmModel GetEdmModel(IServiceProvider serviceProvider)
{
var builder = new ODataConventionModelBuilder(serviceProvider);
...
return builder.GetEdmModel();
}
First off, thanks to everyone for your patience. I know it’s taken a while to get here. Second, thanks to everyone who downloaded and provided feedback on the Alpha/nightly packages.
I’m happy to announce the Beta1 release of Web API OData for ASP.NET and ASP.NET Core. You can find the release notes here: http://odata.github.io/WebApi/#14-01-netcore-beta1
And you’ll find the package here: https://www.nuget.org/packages/Microsoft.AspNetCore.OData/
If you find issues, please file them here on GitHub and add the [feature/netcore] tag.
This is one of five issues tracking the ASP.NET Core version of OData WebApi. To streamline communication, I’m going to close this one and leave #939 open until RTM ships. Please us #939 for following status.