Solti.Utils.OrmLite.Extensions 8.0.0

dotnet add package Solti.Utils.OrmLite.Extensions --version 8.0.0
NuGet\Install-Package Solti.Utils.OrmLite.Extensions -Version 8.0.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="Solti.Utils.OrmLite.Extensions" Version="8.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Solti.Utils.OrmLite.Extensions --version 8.0.0
#r "nuget: Solti.Utils.OrmLite.Extensions, 8.0.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 Solti.Utils.OrmLite.Extensions as a Cake Addin
#addin nuget:?package=Solti.Utils.OrmLite.Extensions&version=8.0.0

// Install Solti.Utils.OrmLite.Extensions as a Cake Tool
#tool nuget:?package=Solti.Utils.OrmLite.Extensions&version=8.0.0

Solti.Utils.OrmLite.Extensions Build status AppVeyor tests (branch) Coverage Status Nuget (with prereleases) GitHub last commit (branch)

ServiceStack.OrmLite extensions

Schema API

using ServiceStack.DataAnnotations;
using Solti.Utils.OrmLite.Extension;
...
[DataTable]
[Values(1, "{4399A489-B140-4A04-BCBC-8C31082F431F}")] // predefined row
private class Table1
{
  [PrimaryKey]
  public int Id { get; set; }
  public Guid Data {get; set;}
}

[DataTable]
[Values(1, 1)]
private class Table2_ReferencingTable1
{
  [PrimaryKey]
  public int Id { get; set; }
  [References(typeof(Table1))]
  public int Table1 { get; set; }
}

[DataTable]
private class Table3_ReferencingNode1AndTable2
{
  [PrimaryKey]
  public int Id { get; set; }
  [References(typeof(Table1))]
  public int Table1 { get; set; }
  [References(typeof(Table2_ReferencingTable1))]
  public int Table2 { get; set;  }
}
...
Schema schema = new(Connection, typeof(Table1).Assembly);

schema.ApplyMigrations(("sql...", "step_1"), ("sql...", "step_2"));

...
schema.Drop();

Bulked write operations

using ServiceStack.OrmLite;
using Solti.Utils.OrmLite.Extension;
...
using IBulkedDbConnection connection = Connection.CreateBulkedDbConnection();
...
connection.Update(...);
connection.Insert(...);
connection.Delte(...);
...
connection.Flush(); // or FlushAsync()

EventRepository

using Solti.Utils.OrmLite.Extension;
using Solti.Utils.OrmLite.Extension.Eventing;
...
// data table
[DataTable]
public class EventTable : Event<string>
{
}

// custom event
public class MyEvent1 
{
  public string Prop1 { get; set; }
}

// custom event
public class MyEvent2
{
  public int Prop2 { get; set; }
}

// materialized view
public class MyView : Aggregate<string, MyEvent1, MyEvent2>
{
  public string Prop1 { get; set; }
  public int? Prop2 { get; set; }
  public override void Apply(MyEvent1 evt) => Prop1 = evt.Prop1;
  public override void Apply(MyEvent2 evt) => Prop2 = evt.Prop2;
}

...

using IDbConnection conn = ConnectionFactory.OpenDbConnection();
conn.CreateTable<EventTable>();

IEventRepository<string, MyView> repo = new EventRepository<string, EventTable, MyView>(conn);

string streamId = "stream_1";

MyView state = await repo.CreateEvent(streamId, new MyEvent1 { Prop1 = "cica" });
state = await repo.CreateEvent(streamId, new MyEvent1 { Prop2 = 1986 });

...

IList<MyView> views = repo.QueryViewsByStreamId(default, "stream_1");

DocumentRepository

using Solti.Utils.OrmLite.Extension;
using Solti.Utils.OrmLite.Extension.Eventing;
...
// data table
[DataTable]
public class DocumentTable : Document<string>
{
}

// materialized view
public class MyView: IEntity<string>
{
  public int Prop { get; set; }
  public string StreamId { get; init; }
}

...

using IDbConnection conn = ConnectionFactory.OpenDbConnection();
conn.CreateTable<DocumentTable>();

IDocumentRepository<string, MyView> repo = new DocumentRepository<string, MyDocument, MyView>(conn);

await repo.InsertOrUpdate(new MyView { StreamId = "cica", Prop = 1986 });

...

IList<MyView> views = await repo.QueryBySimpleCondition<int>("$.Prop", prop => prop == 1986);
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
8.0.0 291 12/23/2022
7.0.0 416 8/31/2022
7.0.0-preview1 135 7/14/2022
6.0.1 548 3/17/2022
6.0.0 539 3/14/2022
5.0.0 294 1/3/2022
4.1.1 285 12/30/2021
4.1.0 269 12/29/2021
4.0.2 439 12/18/2021
4.0.1 353 12/12/2021
4.0.0 342 12/12/2021
4.0.0-preview1 164 12/8/2021
3.0.0 333 10/29/2021
2.1.0 404 4/7/2021
2.0.3 359 4/6/2021
2.0.2 380 4/5/2021
2.0.1 428 3/13/2021
2.0.0 391 3/13/2021
2.0.0-preview1 199 1/25/2021
1.1.3 456 10/21/2020
1.1.2 407 10/21/2020
1.1.1 446 10/5/2020
1.1.0 451 10/2/2020
1.0.1 413 9/28/2020
1.0.0 433 9/28/2020
1.0.0-preview2 396 9/27/2020
1.0.0-preview1 241 9/27/2020