• Stars
    star
    358
  • Rank 118,210 (Top 3 %)
  • Language
    C#
  • License
    Other
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core

ASP.NET Core OData 8.x


Component Build Status
ASP.NET Core OData Rolling Build status
ASP.NET Core OData Nightly Build status
.NET Foundation Release Build status

1. Introduction

Be noted: Switch to use "main" as default branch. 1/6/2022

This is the official ASP.NET Core OData repository. ASP.NET Core OData is a server side library built upon ODataLib and ASP.NET Core.

Blogs:

Example:

  • ODataRoutingSample: ASP.NET Core OData sample project in this repo.

    • ~/$odata gives a static routing table page of the service

    • ~/swagger gives a swagger/openapi page

    • Append ~/$openapi to each route gives a raw openapi OData page, for example, ~/v1/$openapi

    Please go to sample folder see more samples.

Solution:

2. Basic Usage

In the ASP.NET Core Web Application project, update your Startup.cs as below:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddDbContext<BookStoreContext>(opt => opt.UseInMemoryDatabase("BookLists"));
        services.AddControllers().AddOData(opt => opt.AddRouteComponents("odata", GetEdmModel()));
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        // Send "~/$odata" to debug routing if enable the following middleware
        // app.UseODataRouteDebug();

        app.UseRouting();
        app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();
        });
    }

    private static IEdmModel GetEdmModel()
    {
        // โ€ฆ
    }
}

That's it.

3. Building, Testing, Debugging and Release

3.1 Building and Testing in Visual Studio

Visual Studio 2022 is required to build the source project in order to support the DateOnly and TimeOnly types, which were introduced in .NET 6.

3.2 One-click build and test script in command line

Coming soon.

3.3 Debug

The symbol package is uploaded to nuget symbol server.

It supports source link debug. Remember to check Enable Source Link support if you debug using Visual Studio.

3.4 Nightly Builds

The nightly build process will upload NuGet packages for ASP.NET Core OData to:

To connect to webapinightly feed, use this feed URL:

4. Documentation

5. Community

5.1 Contribution

Any contributions, feature requests, bugs and issues are welcome.

5.2 Support

Code of Conduct

This project has adopted the .NET Foundation Contributor Covenant Code of Conduct. For more information see the Code of Conduct FAQ.

.NET Foundation

This project is supported by the .NET Foundation.

AspNetCoreOData is a Copyright of ยฉ .NET Foundation and other contributors. It is licensed under MIT License

More Repositories

1

WebApi

OData Web API: A server library built upon ODataLib and WebApi
C#
854
star
2

odata.net

ODataLib: Open Data Protocol - .NET Libraries and Frameworks
C#
677
star
3

RESTier

A turn-key library for building RESTful services
C#
468
star
4

ODataSamples

Samples: For ODataLib, OData Web API, RESTier, etc.
C#
290
star
5

OData.Neo

C#
108
star
6

odatapy-client

OData Python client
C++
89
star
7

ODataConnectedService

A Visual Studio extension for generating client code for OData Services
C#
70
star
8

OData4ObjC

OData client for iOS.
Objective-C
69
star
9

odataorg.github.io

Staging site and collaboration repository for http://www.odata.org
HTML
60
star
10

lab

This repository is for exploring new ideas and developing early prototypes of various OData stacks.
C#
48
star
11

odatacpp-client

OData C++ Client Libraries
C++
44
star
12

odatacpp-server

OData C++ Server Libraries
C++
32
star
13

model-first

Model-first tooling
JavaScript
28
star
14

ModelBuilder

A project to generate Edm (Entity Data Model) from CLR types
C#
19
star
15

ValidationTool

Enable OData service authors ensure that their service interoperates well with any OData client.
C#
19
star
16

odata.github.io

Documentation source of Microsoft OData stack.
CSS
12
star
17

vocabularies

OData vocabulary definitions and usage
11
star
18

v3ProtocolDocument

Short-lived project to collaboratively edit the OData v3 protocol document.
Shell
11
star
19

Extensions

ExtensionsLib: - Extensions for OData libraries and framework
C#
10
star
20

WebApiAuthorization

C#
9
star
21

RequestBuilder

REST Request builder for OData services
5
star
22

Home

This is the Home repository for discussion, design spec, feedback, Q&A of OData related.
1
star
23

OData4Soda

OData service that translates calls into calls against an underlying SODA service.
1
star