Solti.Utils.OrmLite.Extensions 7.0.0-preview1

This is a prerelease version of Solti.Utils.OrmLite.Extensions.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Solti.Utils.OrmLite.Extensions --version 7.0.0-preview1
                    
NuGet\Install-Package Solti.Utils.OrmLite.Extensions -Version 7.0.0-preview1
                    
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="7.0.0-preview1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Solti.Utils.OrmLite.Extensions" Version="7.0.0-preview1" />
                    
Directory.Packages.props
<PackageReference Include="Solti.Utils.OrmLite.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Solti.Utils.OrmLite.Extensions --version 7.0.0-preview1
                    
#r "nuget: Solti.Utils.OrmLite.Extensions, 7.0.0-preview1"
                    
#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.
#:package Solti.Utils.OrmLite.Extensions@7.0.0-preview1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Solti.Utils.OrmLite.Extensions&version=7.0.0-preview1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Solti.Utils.OrmLite.Extensions&version=7.0.0-preview1&prerelease
                    
Install as a Cake Tool

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;  }
}
...
var schema = new Schema(Connection, typeof(Table1).Assembly);

if (!schema.IsInitialized)
  schema.Initialze();
else
{
  schema.Migrate(step_1_timestamp, "sql...", "step_1");
  schema.Migrate(step_2_timestamp, "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.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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 452 12/23/2022 8.0.0 is deprecated because it is no longer maintained.
7.0.0 519 8/31/2022 7.0.0 is deprecated because it is no longer maintained.
7.0.0-preview1 238 7/14/2022 7.0.0-preview1 is deprecated because it is no longer maintained.
6.0.1 673 3/17/2022 6.0.1 is deprecated because it is no longer maintained.
6.0.0 658 3/14/2022 6.0.0 is deprecated because it is no longer maintained.
5.0.0 434 1/3/2022 5.0.0 is deprecated because it is no longer maintained.
4.1.1 410 12/30/2021 4.1.1 is deprecated because it is no longer maintained.
4.1.0 392 12/29/2021 4.1.0 is deprecated because it is no longer maintained.
4.0.2 570 12/18/2021 4.0.2 is deprecated because it is no longer maintained.
4.0.1 475 12/12/2021 4.0.1 is deprecated because it is no longer maintained.
4.0.0 471 12/12/2021 4.0.0 is deprecated because it is no longer maintained.
4.0.0-preview1 280 12/8/2021 4.0.0-preview1 is deprecated because it is no longer maintained.
3.0.0 464 10/29/2021 3.0.0 is deprecated because it is no longer maintained.
2.1.0 536 4/7/2021 2.1.0 is deprecated because it is no longer maintained.
2.0.3 495 4/6/2021 2.0.3 is deprecated because it is no longer maintained.
2.0.2 515 4/5/2021 2.0.2 is deprecated because it is no longer maintained.
2.0.1 561 3/13/2021 2.0.1 is deprecated because it is no longer maintained.
2.0.0 516 3/13/2021 2.0.0 is deprecated because it is no longer maintained.
2.0.0-preview1 332 1/25/2021 2.0.0-preview1 is deprecated because it is no longer maintained.
1.1.3 598 10/21/2020 1.1.3 is deprecated because it is no longer maintained.
1.1.2 556 10/21/2020 1.1.2 is deprecated because it is no longer maintained.
1.1.1 578 10/5/2020 1.1.1 is deprecated because it is no longer maintained.
1.1.0 588 10/2/2020 1.1.0 is deprecated because it is no longer maintained.
1.0.1 555 9/28/2020 1.0.1 is deprecated because it is no longer maintained.
1.0.0 564 9/28/2020 1.0.0 is deprecated because it is no longer maintained.
1.0.0-preview2 523 9/27/2020 1.0.0-preview2 is deprecated because it is no longer maintained.
1.0.0-preview1 367 9/27/2020 1.0.0-preview1 is deprecated because it is no longer maintained.