RedOrb 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package RedOrb --version 0.2.0                
NuGet\Install-Package RedOrb -Version 0.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RedOrb" Version="0.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RedOrb --version 0.2.0                
#r "nuget: RedOrb, 0.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RedOrb as a Cake Addin
#addin nuget:?package=RedOrb&version=0.2.0

// Install RedOrb as a Cake Tool
#tool nuget:?package=RedOrb&version=0.2.0                

RedOrb

Simple, Intuitive, ORM

ORM for people who simply want to access a database.

Demo

Although a configuration file is required, CRUD processing is very simple to write.

Model

public class Blog
{
    public int? BlogId { get; set; }
    public string Url { get; set; } = string.Empty;
}

Create Table

using RedOrb;

using IDbConnection cn = SomethingMethod();

cn.CreateTableOrDefault<Blog>();

Create

using RedOrb;

using IDbConnection cn = SomethingMethod();

var newBlog = new Blog { Url = "http://blogs.msdn.com/adonet" };
cn.Save(newBlog);

Read

using RedOrb;

using IDbConnection cn = SomethingMethod();

var blog = cn.Load(new Blog() { BlodId = 1 });

Update

using RedOrb;

using IDbConnection cn = SomethingMethod();

var blog = cn.Load(new Blog() { BlodId = 1 });

blog.Url = "https://devblogs.microsoft.com/dotnet";

cn.Save(blog);

Delete

using RedOrb;

using IDbConnection cn = SomethingMethod();

cn.Delete(new Blog() { BlodId = 1 });

Configuration

using RedOrb;

ObjectRelationMapper.PlaceholderIdentifer = ":";

var def = new DbTableDefinition<Blog>()
{
    TableName = "blogs",
    ColumnDefinitions =
    {
        new () {Identifer = nameof(Blog.BlogId), ColumnName = "blog_id", ColumnType= "serial8", RelationColumnType = "bigint", IsPrimaryKey= true, IsAutoNumber = true},
        new () {Identifer = nameof(Blog.Url), ColumnName = "url", ColumnType= "text"},
    },
    Indexes =
    {
        new() {Identifers = { nameof(Blog.Url) }, IsUnique = true},
    }
};

ObjectRelationMapper.AddTypeHandler(def);

Features

General

  • Connection classes are not hidden
  • Supports SQL logging
  • DBMS independent
  • Supports sequence keys
  • Supports composite keys

When reading

  • All tables with a 1:1 or 1:0..1 relationship are joined and read (default)
  • You can set whether to join tables.
  • You can use primary key search and unique key search.
  • You can also specify any search conditions.

When saving

  • All tables with 1 to 0..N relationships are saved.

Constraints

General

  • When using sequence keys, please make the type Nullable
  • Connection class generation is out of scope
  • Requires creation of table definition class

When reading

  • Column filtering is not possible.
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.5.9 153 1/13/2024
0.5.8 130 1/5/2024
0.5.7 104 1/3/2024
0.5.6 114 12/31/2023
0.5.3 112 12/29/2023
0.5.2.2 107 12/27/2023
0.5.2.1 122 12/27/2023
0.5.2 112 12/27/2023
0.5.1 117 12/25/2023
0.5.0 137 12/24/2023
0.4.1 118 12/17/2023
0.4.0 112 12/17/2023
0.3.1 117 12/16/2023
0.3.0 111 12/16/2023
0.2.1 113 12/16/2023
0.2.0 125 12/16/2023
0.1.0 129 9/10/2023