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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Solti.Utils.OrmLite.Extensions
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 | Versions 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.
-
.NETStandard 2.0
- ProxyGen.NET (>= 8.0.0)
- ServiceStack.OrmLite.Core (>= 5.14.0)
- Solti.Utils.Primitives (>= 7.1.0)
- System.Text.Json (>= 5.0.2)
-
.NETStandard 2.1
- ProxyGen.NET (>= 8.0.0)
- ServiceStack.OrmLite.Core (>= 5.14.0)
- Solti.Utils.Primitives (>= 7.1.0)
- System.Text.Json (>= 5.0.2)
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 | 338 | 12/23/2022 |
7.0.0 | 452 | 8/31/2022 |
7.0.0-preview1 | 166 | 7/14/2022 |
6.0.1 | 587 | 3/17/2022 |
6.0.0 | 573 | 3/14/2022 |
5.0.0 | 330 | 1/3/2022 |
4.1.1 | 324 | 12/30/2021 |
4.1.0 | 304 | 12/29/2021 |
4.0.2 | 478 | 12/18/2021 |
4.0.1 | 390 | 12/12/2021 |
4.0.0 | 375 | 12/12/2021 |
4.0.0-preview1 | 194 | 12/8/2021 |
3.0.0 | 371 | 10/29/2021 |
2.1.0 | 438 | 4/7/2021 |
2.0.3 | 391 | 4/6/2021 |
2.0.2 | 415 | 4/5/2021 |
2.0.1 | 464 | 3/13/2021 |
2.0.0 | 424 | 3/13/2021 |
2.0.0-preview1 | 239 | 1/25/2021 |
1.1.3 | 495 | 10/21/2020 |
1.1.2 | 440 | 10/21/2020 |
1.1.1 | 478 | 10/5/2020 |
1.1.0 | 488 | 10/2/2020 |
1.0.1 | 449 | 9/28/2020 |
1.0.0 | 464 | 9/28/2020 |
1.0.0-preview2 | 428 | 9/27/2020 |
1.0.0-preview1 | 268 | 9/27/2020 |