Skip to content

Commit

Permalink
add endpoint project, convert rowversion from string to int
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Dec 31, 2023
1 parent 7c8bcfb commit a048db0
Show file tree
Hide file tree
Showing 75 changed files with 1,217 additions and 304 deletions.
20 changes: 20 additions & 0 deletions MediatR.CommandQuery.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,25 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediatR.CommandQuery.MongoDB.Tests", "test\MediatR.CommandQuery.MongoDB.Tests\MediatR.CommandQuery.MongoDB.Tests.csproj", "{ADCC6D4F-E6A0-4736-80FE-918E2592A9FF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{2E91BC5A-6D57-4EFD-A693-4D96B295FDB5}"
ProjectSection(SolutionItems) = preProject
samples\TrackerService.sql = samples\TrackerService.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tracker.WebService.MongoDB", "samples\Tracker.WebService.MongoDB\Tracker.WebService.MongoDB.csproj", "{10338169-75AF-4E52-818A-E656C77CAA90}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tracker.WebService.EntityFrameworkCore", "samples\Tracker.WebService.EntityFrameworkCore\Tracker.WebService.EntityFrameworkCore.csproj", "{29537166-4CA5-4201-845C-8BC5B39D0966}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{178BF52C-04A0-4B7D-89CA-41E14912A2D5}"
ProjectSection(SolutionItems) = preProject
templates\DomainJsonContext.csx = templates\DomainJsonContext.csx
templates\DomainServiceRegistration.csx = templates\DomainServiceRegistration.csx
templates\EntityCommandEndpoint.csx = templates\EntityCommandEndpoint.csx
templates\EntityController.csx = templates\EntityController.csx
templates\EntityQueryEndpoint.csx = templates\EntityQueryEndpoint.csx
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediatR.CommandQuery.Endpoints", "src\MediatR.CommandQuery.Endpoints\MediatR.CommandQuery.Endpoints.csproj", "{C07AB804-A503-45A3-A874-01175332E666}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -227,6 +235,18 @@ Global
{29537166-4CA5-4201-845C-8BC5B39D0966}.Release|x64.Build.0 = Release|Any CPU
{29537166-4CA5-4201-845C-8BC5B39D0966}.Release|x86.ActiveCfg = Release|Any CPU
{29537166-4CA5-4201-845C-8BC5B39D0966}.Release|x86.Build.0 = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|x64.ActiveCfg = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|x64.Build.0 = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|x86.ActiveCfg = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Debug|x86.Build.0 = Debug|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|Any CPU.Build.0 = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|x64.ActiveCfg = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|x64.Build.0 = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|x86.ActiveCfg = Release|Any CPU
{C07AB804-A503-45A3-A874-01175332E666}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public class DataServiceRegistration
public void Register(IServiceCollection services)
{
services.AddDbContext<TrackerServiceContext>(
(serviceProvider, options) =>
optionsAction: (serviceProvider, options) =>
{
var configuration = serviceProvider.GetRequiredService<IConfiguration>();
var connectionString = configuration.GetConnectionString("Tracker");

options.UseSqlServer(connectionString, providerOptions => providerOptions.EnableRetryOnFailure());
},
ServiceLifetime.Transient
contextLifetime: ServiceLifetime.Transient,
optionsLifetime: ServiceLifetime.Transient
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Audit()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Priority()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Role()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Status()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Task()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public User()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public UserLogin()

public string? UpdatedBy { get; set; }

public Byte[] RowVersion { get; set; } = null!;
public long RowVersion { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,25 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
#endregion
}

#region Generated Constants
public struct Table
public readonly struct Table
{
public const string Schema = "dbo";
public const string Name = "Audit";
}

public struct Columns
public readonly struct Columns
{
public const string Id = "Id";
public const string Date = "Date";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType
builder.Property(t => t.DisplayOrder)
.IsRequired()
.HasColumnName("DisplayOrder")
.HasColumnType("int");
.HasColumnType("int")
.HasDefaultValue(0);

builder.Property(t => t.IsActive)
.IsRequired()
.HasColumnName("IsActive")
.HasColumnType("bit")
.HasDefaultValueSql("((1))");
.HasDefaultValue(true);

builder.Property(t => t.Created)
.IsRequired()
Expand All @@ -70,24 +71,25 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
#endregion
}

#region Generated Constants
public struct Table
public readonly struct Table
{
public const string Schema = "dbo";
public const string Name = "Priority";
}

public struct Columns
public readonly struct Columns
{
public const string Id = "Id";
public const string Name = "Name";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,25 @@ public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityType

builder.Property(t => t.RowVersion)
.IsRequired()
.HasConversion<byte[]>()
.IsRowVersion()
.IsConcurrencyToken()
.HasColumnName("RowVersion")
.HasColumnType("rowversion")
.HasMaxLength(8)
.ValueGeneratedOnAddOrUpdate();

// relationships
#endregion
}

#region Generated Constants
public struct Table
public readonly struct Table
{
public const string Schema = "dbo";
public const string Name = "Role";
}

public struct Columns
public readonly struct Columns
{
public const string Id = "Id";
public const string Name = "Name";
Expand Down
Loading

0 comments on commit a048db0

Please sign in to comment.