![]() |
VOOZH | about |
dotnet add package Microsoft.OData.Edm --version 8.4.3
NuGet\Install-Package Microsoft.OData.Edm -Version 8.4.3
<PackageReference Include="Microsoft.OData.Edm" Version="8.4.3" />
<PackageVersion Include="Microsoft.OData.Edm" Version="8.4.3" />Directory.Packages.props
<PackageReference Include="Microsoft.OData.Edm" />Project file
paket add Microsoft.OData.Edm --version 8.4.3
#r "nuget: Microsoft.OData.Edm, 8.4.3"
#:package Microsoft.OData.Edm@8.4.3
#addin nuget:?package=Microsoft.OData.Edm&version=8.4.3Install as a Cake Addin
#tool nuget:?package=Microsoft.OData.Edm&version=8.4.3Install as a Cake Tool
The Microsoft.OData.Edm library provides APIs to build, parse, and validate Entity Data Model (EDM) that conform to the OData protocol. It is a core component of the OData .NET libraries, enabling you to work with OData metadata.
Think of it as the schema that describes the kind of data your service exposes. The Microsoft.OData.Edm library, also known as EdmLib, provides classes and interfaces for working with OData models. It includes classes for reading/parsing a schema file in CSDL in XML or JSON formats, writing such files (CsdlReader and CsdlWriter), as well as creating a model directly in-memory (EdmModel).
The IEdmModel interface is used extensively across OData libraries as it provides the base layer for retrieving information about the types and functionality exposed by an OData service.
The EdmModel class (which implements the IEdmModel interface) allows you to manually create a model/schema in memory.
You can install the Microsoft.OData.Edm package via NuGet:
dotnet add package Microsoft.OData.Edm
Or via the NuGet Package Manager Console:
Install-Package Microsoft.OData.Edm
Here's a simple example of how to create an EDM model using Microsoft.OData.Edm:
using Microsoft.OData.Edm;
using System;
namespace EdmLibSample;
public class SampleModelBuilder
{
public static IEdmModel GetEdmModel()
{
// Create an empty model
var model = new EdmModel();
// Define an entity type
var productType = new EdmEntityType("NS", "Product");
productType.AddKeys(productType.AddStructuralProperty("ID", EdmPrimitiveTypeKind.Int32));
productType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String);
model.AddElement(productType);
// Define an entity container
var container = new EdmEntityContainer("NS", "Container");
model.AddElement(container);
// Define an entity set
var products = container.AddEntitySet("Products", productType);
// Output the model
Console.WriteLine("EDM Model created successfully.");
return model;
}
}
You can also parse an EDM model from a CSDL (Common Schema Definition Language) document:
using Microsoft.OData.Edm.Csdl;
using Microsoft.OData.Edm;
using System.Xml;
string csdl = @"
<edmx:Edmx Version=""4.0"" xmlns:edmx=""http://docs.oasis-open.org/odata/ns/edmx"">
<edmx:DataServices>
<Schema Namespace=""NS"" xmlns=""http://docs.oasis-open.org/odata/ns/edm"">
<EntityType Name='Product'>
<Key>
<PropertyRef Name='ID' />
</Key>
<Property Name='ID' Type='Edm.Int32' Nullable='false' />
<Property Name='Name' Type='Edm.String' />
</EntityType>
<EntityContainer Name='Container'>
<EntitySet Name='Products' EntityType='NS.Product' />
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>";
IEdmModel model;
using (var reader = XmlReader.Create(new StringReader(csdl)))
{
model = CsdlReader.Parse(reader);
Console.WriteLine("EDM Model parsed successfully.");
}
For more detailed information, please refer to the official documentation.
There are many ways for you to contribute to OData .NET. The easiest way is to participate in discussion of features and issues. You can also contribute by sending pull requests of features or bug fixes to us. Contribution to the documentations is also highly welcomed. Please refer to the CONTRIBUTING.md for more details.
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) . You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 5 NuGet packages that depend on Microsoft.OData.Edm:
| Package | Downloads |
|---|---|
|
Microsoft.OData.Core
Classes to serialize, deserialize and validate OData JSON payloads. Supports OData v4 and v4.01. Enables construction of OData services and clients. Targets .NET 8 or above. OData .NET library is open source at http://github.com/OData/odata.net. Documentation for the library can be found at https://docs.microsoft.com/en-us/odata/. |
|
|
Microsoft.AspNetCore.OData
This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC Core 10.x to support OData query syntax for your Web APIs. |
|
|
Microsoft.OData.ModelBuilder
This package contains APIs to create OData Edm (Entity Data Model) using C# types, attributes and conventions. |
|
|
Microsoft.OpenApi.OData
This package contains the codes you need to convert OData CSDL to Open API Document of Model. |
|
|
Swashbuckle.OData
Extends Swashbuckle with OData v4 support! Supports both WebApi and OData controllers! |
Showing the top 20 popular GitHub repositories that depend on Microsoft.OData.Edm:
| Repository | Stars |
|---|---|
|
smartstore/SmartStoreNET
Open Source ASP.NET MVC Enterprise eCommerce Shopping Cart Solution
|
|
|
pnp/PnP
SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
|
|
|
microsoft/OpenAPI.NET
The OpenAPI.NET SDK contains a useful object model for OpenAPI documents in .NET along with common serializers to extract raw OpenAPI JSON and YAML documents from the model.
|
|
|
Azure/data-api-builder
Data API builder provides modern REST, GraphQL endpoints and MCP tools to your Azure Databases and on-prem stores.
|
|
|
microsoft/PowerPlatformConnectors
This is a repository for Microsoft Power Automate, Power Apps, and Azure Logic Apps connectors
|
|
|
OfficeDev/TrainingContent
Training Content used for developer.microsoft.com/office
|
|
|
OData/WebApi
OData Web API: A server library built upon ODataLib and WebApi
|
|
|
OData/AspNetCoreOData
ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core
|
|
|
OData/RESTier
A turn-key library for building RESTful services
|
|
|
telerik/xaml-sdk
The XAML SDK is an easy-to-use infrastructure with 1000+ developer focused examples for most of the Telerik UI for WPF controls.
|
|
|
microsoft/BotFramework-BlogSamples
Welcome to the Bot Framework samples repository. Here you will find sample bots that take advantage of Bot Framework capabilities.
|
|
| rstropek/Samples | |
|
filipw/apress-recipes-webapi
Samples from ASP.NET Web API 2: Recipes book.
|
|
|
microsoft/Dynamics-AX-Integration
Dynamics AX Integration samples and demos.
|
|
|
OData/ODataSamples
Samples: For ODataLib, OData Web API, RESTier, etc.
|
|
|
ShaneK2/inVtero.net
inVtero.net: A high speed (Gbps) Forensics, Memory integrity & assurance. Includes offensive & defensive memory capabilities. Find/Extract processes, hypervisors (including nested) in memory dumps using microarchitechture independent Virtual Machiene Introspection techniques
|
|
|
microsoft/OpenAPI.NET.OData
Generates OpenAPI document from OData CSDL
|
|
|
zLulus/NotePractice
My_Note 笔记练习demo
|
|
|
Azure/azure-stream-analytics
Azure Stream Analytics
|
|
|
martin-nikolov/Telerik-Academy
Course exercises | Telerik Academy 2013/2014 | Martin Nikolov
|
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.0-rc | 1,313 | 5/5/2026 |
| 9.0.0-preview.4 | 25,669 | 1/18/2026 |
| 9.0.0-preview.3 | 48,433 | 11/21/2025 |
| 9.0.0-preview.2 | 4,045 | 8/21/2025 |
| 9.0.0-preview.1 | 1,309 | 7/10/2025 |
| 8.4.3 | 1,834,021 | 11/13/2025 |
| 8.4.2 | 236,228 | 10/23/2025 |
| 8.4.0 | 3,498,394 | 9/10/2025 |
| 8.3.0 | 701,533 | 7/10/2025 |
| 8.2.4 | 230,736 | 6/24/2025 |
| 8.2.3 | 7,016,904 | 12/11/2024 |
| 8.2.2 | 1,508,765 | 11/19/2024 |
| 8.2.1 | 110,062 | 11/13/2024 |
| 8.2.0 | 537,367 | 11/8/2024 |
| 8.1.0 | 780,505 | 10/17/2024 |
| 7.22.0 | 636,400 | 7/10/2025 |
| 7.21.7 | 119,586 | 6/23/2025 |
| 7.21.6 | 3,031,204 | 11/8/2024 |
| 7.21.5 | 331,082 | 10/22/2024 |
| 7.21.4 | 278,305 | 9/30/2024 |