File tree 8 files changed +135
-1
lines changed
8 files changed +135
-1
lines changed Original file line number Diff line number Diff line change 16
16
<PackageReference Include =" Petabridge.Cmd.Cluster" Version =" $(PbmVersion)" />
17
17
<PackageReference Include =" Petabridge.Cmd.Cluster.Sharding" Version =" $(PbmVersion)" />
18
18
<PackageReference Include =" Petabridge.Cmd.Host" Version =" $(PbmVersion)" />
19
+ <PackageReference Include =" Microsoft.Extensions.Configuration.Json" Version =" $(MicrosoftExtensionsVersion)" />
20
+ <PackageReference Include =" Microsoft.Extensions.Configuration.EnvironmentVariables" Version =" $(MicrosoftExtensionsVersion)" />
19
21
</ItemGroup >
20
22
21
23
<ItemGroup >
22
- <Folder Include =" Actors\" />
24
+ <Content Include =" appsettings.json" >
25
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
26
+ </Content >
27
+ <Content Include =" appsettings.Development.json" >
28
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
29
+ </Content >
30
+ <Content Include =" appsettings.Production.json" >
31
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
32
+ </Content >
33
+ <None Remove =" sharding.conf" />
23
34
</ItemGroup >
24
35
36
+ <ItemGroup >
37
+ <Folder Include =" Configuration\" />
38
+ </ItemGroup >
25
39
</Project >
Original file line number Diff line number Diff line change
1
+ {
2
+ "Logging" : {
3
+ "LogLevel" : {
4
+ "Default" : " Debug" ,
5
+ "System" : " Information" ,
6
+ "Microsoft" : " Information"
7
+ }
8
+ },
9
+ "ConnectionStrings" : {
10
+ "AkkaSqlConnection" : " Server=localhost,1533; Database=Akka; User Id=sa; Password=yourStrong(!)Password; TrustServerCertificate=true;"
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "Logging" : {
3
+ "LogLevel" : {
4
+ "Default" : " Debug" ,
5
+ "System" : " Information" ,
6
+ "Microsoft" : " Information"
7
+ }
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "Logging" : {
3
+ "LogLevel" : {
4
+ "Default" : " Debug" ,
5
+ "System" : " Information" ,
6
+ "Microsoft" : " Information"
7
+ }
8
+ }
9
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+
3
+ <PropertyGroup >
4
+ <TargetFramework >net8.0</TargetFramework >
5
+ <ImplicitUsings >enable</ImplicitUsings >
6
+ <Nullable >enable</Nullable >
7
+ </PropertyGroup >
8
+
9
+ <ItemGroup >
10
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.Design" Version =" 8.0.3" >
11
+ <PrivateAssets >all</PrivateAssets >
12
+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
13
+ </PackageReference >
14
+ <PackageReference Include =" Microsoft.EntityFrameworkCore.SqlServer" Version =" 8.0.3" />
15
+ </ItemGroup >
16
+
17
+ </Project >
Original file line number Diff line number Diff line change
1
+ using CqrsSqlServer . DataModel . Entities ;
2
+ using Microsoft . EntityFrameworkCore ;
3
+
4
+ namespace CqrsSqlServer . DataModel ;
5
+
6
+ public class CqrsSqlServerContext : DbContext
7
+ {
8
+ public DbSet < ProductListing > Products { get ; set ; }
9
+
10
+ public const int ProductIdMaxLength = 128 ;
11
+ public const int ProductNameMaxLength = 256 ;
12
+
13
+ public CqrsSqlServerContext ( DbContextOptions < CqrsSqlServerContext > options )
14
+ : base ( options )
15
+ {
16
+ }
17
+
18
+ // The following configures EF to create a Sqlite database file in the
19
+ // special "local" folder for your platform.
20
+ protected override void OnConfiguring ( DbContextOptionsBuilder optionsBuilder )
21
+ {
22
+ optionsBuilder . EnableDetailedErrors ( ) ;
23
+ base . OnConfiguring ( optionsBuilder ) ;
24
+ }
25
+
26
+ protected override void OnModelCreating ( ModelBuilder modelBuilder )
27
+ {
28
+ modelBuilder . Entity < ProductListing > ( entity =>
29
+ {
30
+ entity . Property ( c => c . ProductId )
31
+ . HasMaxLength ( ProductIdMaxLength )
32
+ . IsRequired ( ) ;
33
+
34
+ entity . Property ( c => c . ProductName )
35
+ . HasMaxLength ( ProductNameMaxLength )
36
+ . IsRequired ( ) ;
37
+
38
+ entity . HasKey ( c => c . ProductId ) ;
39
+ } ) ;
40
+ }
41
+ }
Original file line number Diff line number Diff line change
1
+ // -----------------------------------------------------------------------
2
+ // <copyright file="ProductListing.cs" company="Akka.NET Project">
3
+ // Copyright (C) 2013-2024 .NET Foundation <https://github.com/akkadotnet/akka.net>
4
+ // </copyright>
5
+ // -----------------------------------------------------------------------
6
+
7
+ namespace CqrsSqlServer . DataModel . Entities ;
8
+
9
+ public class ProductListing
10
+ {
11
+ public string ProductId { get ; set ; } = null ! ;
12
+
13
+ public string ProductName { get ; set ; } = null ! ;
14
+
15
+ public decimal Price { get ; set ; }
16
+
17
+ public int RemainingInventory { get ; set ; }
18
+
19
+ public int SoldUnits { get ; set ; }
20
+
21
+ public decimal TotalRevenue { get ; set ; }
22
+
23
+ public DateTime Created { get ; set ; }
24
+
25
+ public DateTime LastModified { get ; set ; }
26
+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CqrsSqlServer.Shared", "Cqr
7
7
EndProject
8
8
Project ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" ) = "CqrsSqlServer.Backend" , "CqrsSqlServer.Backend\CqrsSqlServer.Backend.csproj" , "{E5872C18-242A-4F52-BBE4-CF4CB272CC4E}"
9
9
EndProject
10
+ Project ("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" ) = "CqrsSqlServer.DataModel" , "CqrsSqlServer.DataModel\CqrsSqlServer.DataModel.csproj" , "{A1B9790C-AC65-46C0-8BC5-2C4013F5245D}"
11
+ EndProject
10
12
Global
11
13
GlobalSection (SolutionConfigurationPlatforms ) = preSolution
12
14
Debug| Any CPU = Debug| Any CPU
24
26
{E5872C18-242A-4F52-BBE4-CF4CB272CC4E} .Debug| Any CPU .Build .0 = Debug| Any CPU
25
27
{E5872C18-242A-4F52-BBE4-CF4CB272CC4E} .Release| Any CPU .ActiveCfg = Release| Any CPU
26
28
{E5872C18-242A-4F52-BBE4-CF4CB272CC4E} .Release| Any CPU .Build .0 = Release| Any CPU
29
+ {A1B9790C-AC65-46C0-8BC5-2C4013F5245D} .Debug| Any CPU .ActiveCfg = Debug| Any CPU
30
+ {A1B9790C-AC65-46C0-8BC5-2C4013F5245D} .Debug| Any CPU .Build .0 = Debug| Any CPU
31
+ {A1B9790C-AC65-46C0-8BC5-2C4013F5245D} .Release| Any CPU .ActiveCfg = Release| Any CPU
32
+ {A1B9790C-AC65-46C0-8BC5-2C4013F5245D} .Release| Any CPU .Build .0 = Release| Any CPU
27
33
EndGlobalSection
28
34
EndGlobal
You can’t perform that action at this time.
0 commit comments