CreateIf.OdooSharp.Codegen
0.0.10
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet tool install --global CreateIf.OdooSharp.Codegen --version 0.0.10
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local CreateIf.OdooSharp.Codegen --version 0.0.10
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CreateIf.OdooSharp.Codegen&version=0.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package CreateIf.OdooSharp.Codegen --version 0.0.10
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OdooSharp JSON-RPC C# ORM Client
A type-safe, extensible C# client for interacting with the Odoo JSON-RPC API.
Supports full CRUD, filtering, paging, and model-level attributes for clean data access.
๐ Features
- ๐ Auth via JSON-RPC (
/web/session/authenticate
) - ๐ Generic
search_read
with domain, fields, paging, sorting - ๐
create
, โ๏ธwrite
, ๐๏ธunlink
, ๐ฅread
(by ID) - ๐ง Model-level
[OdooModel(...)]
attribute for smart mapping - ๐ Paged queries
- โ
Typed response classes via
System.Text.Json
๐ฆ Installation
Just include the nuget package CreateIf.Odoo
and your typed model classes into your project.
Requires .netstandard2.1 or compatible with HttpClient
, System.Text.Json
.
๐ ๏ธ Configuration
var options = new OdooClientOptions
{
Url = "https://your-odoo-instance.odoo.com",
Database = "your-database-name",
Username = "your-user@example.com",
Password = "your-password"
};
var client = new OdooClient(options);
๐งช Usage
var client = new OdooClient(new OdooClientOptions
{
Url = "https://your-odoo-url.odoo.com",
Database = "your-db",
Username = "you@example.com",
Password = "your-password"
});
if (await client.AuthenticateAsync())
{
Console.WriteLine("Authenticated.");
var models = await client.GetModelsAsync();
// you can use your custom defined models too
var quotes = await client.SearchReadAsync<Lieferangebot>(
model: "x_lieferangebot",
domain: new object[] { new object[] { "x_status", "=", "offen" } },
fields: new[] { "x_name", "x_preis", "x_status" },
limit: 100
);
}
else
{
Console.WriteLine("Authentication failed.");
}
The custom model class
[OdooModel("x_lieferangebot", "[[\"x_status\", \"=\", \"offen\"]]")]
public class Lieferangebot
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("x_name")]
public string Name { get; set; }
[JsonPropertyName("x_preis")]
public float Preis { get; set; }
[JsonPropertyName("x_status")]
public string Status { get; set; }
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.