Skip to content

Commit 45331c6

Browse files
committed
[r] sln file
[r] to primary constructors [edit] handler await [up] Simplify.Scheduler bump to 1.5 [up] Microsoft.Extensions.Configuration.Json bump to 8 [edit] Platform set to AnyCPU
1 parent ec4aad4 commit 45331c6

File tree

12 files changed

+45
-72
lines changed

12 files changed

+45
-72
lines changed

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Database/Mappings/MyEntityMap.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33

44
namespace MyProjectSchedulerWithDatabase.Database.Mappings;
55

6-
public class MyEntityMap : IdentityObjectMap<MyEntity>
7-
{
8-
}
6+
public class MyEntityMap : IdentityObjectMap<MyEntity>;

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Database/MyEntities/MyEntity.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33

44
namespace MyProjectSchedulerWithDatabase.Database.MyEntities;
55

6-
public class MyEntity : IdentityObject, IMyEntity
7-
{
8-
}
6+
public class MyEntity : IdentityObject, IMyEntity;

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Database/MyProjectWindowsServiceWithDatabaseSessionFactoryBuilder.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
using Microsoft.Extensions.Configuration;
21
using FluentNHibernate.Cfg;
32
using FluentNHibernate.Conventions.Helpers;
3+
using Microsoft.Extensions.Configuration;
44
using Simplify.FluentNHibernate;
55
using Simplify.FluentNHibernate.Conventions;
6-
using Simplify.Repository.FluentNHibernate;
76

87
namespace MyProjectSchedulerWithDatabase.Database;
98

10-
public class MyProjectSchedulerWithDatabaseSessionFactoryBuilder : SessionFactoryBuilderBase
9+
public class MyProjectSchedulerWithDatabaseSessionFactoryBuilder(IConfiguration configuration)
10+
: SessionFactoryBuilderBase(configuration, "MyProjectSchedulerWithDatabaseDatabaseConnectionSettings")
1111
{
12-
public MyProjectSchedulerWithDatabaseSessionFactoryBuilder(IConfiguration configuration)
13-
: base(configuration, "MyProjectSchedulerWithDatabaseDatabaseConnectionSettings")
14-
{
15-
}
16-
1712
public override FluentConfiguration CreateConfiguration() =>
1813
FluentConfiguration.InitializeFromConfigMsSql(Configuration, ConfigSectionName)
1914
.AddMappingsFromAssemblyOf<MyProjectSchedulerWithDatabaseSessionFactoryBuilder>(PrimaryKey.Name.Is(x => "ID"),

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Database/MyProjectWindowsServiceWithDatabaseUnitOfWork.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,5 @@
33

44
namespace MyProjectSchedulerWithDatabase.Database;
55

6-
public class MyProjectSchedulerWithDatabaseUnitOfWork : TransactUnitOfWork, IMyProjectSchedulerWithDatabaseUnitOfWork
7-
{
8-
public MyProjectSchedulerWithDatabaseUnitOfWork(ISessionFactory sessionFactory) : base(sessionFactory)
9-
{
10-
}
11-
}
6+
public class MyProjectSchedulerWithDatabaseUnitOfWork(ISessionFactory sessionFactory)
7+
: TransactUnitOfWork(sessionFactory), IMyProjectSchedulerWithDatabaseUnitOfWork;

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Service/MyProjectSchedulerWithDatabase.Service.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<ProjectReference Include="..\MyProjectSchedulerWithDatabase.Database\MyProjectSchedulerWithDatabase.Database.csproj" />
1212
</ItemGroup>
1313
<ItemGroup>
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.*" />
15-
<PackageReference Include="Simplify.Scheduler" Version="1.3.*" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.*" />
15+
<PackageReference Include="Simplify.Scheduler" Version="1.5.*" />
1616

1717
<PackageReference Include="Simplify.DI.Provider.SimpleInjector" Version="1.11.*" />
1818
</ItemGroup>

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Service/Program.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
using var scheduler = new SingleTaskScheduler<Worker>(IocRegistrations.Configuration)
1313
.SubscribeLog();
1414

15-
if (!scheduler.Start(args))
15+
if (!await scheduler.StartAsync(args))
1616
{
1717
// One-time launch of user code without the scheduler
1818

1919
using var scope = DIContainer.Current.BeginLifetimeScope();
2020

21-
scope.Resolver.Resolve<Worker>()
22-
.Run()
23-
.ConfigureAwait(false)
24-
.GetAwaiter()
25-
.GetResult();
26-
}
21+
await scope.Resolver.Resolve<Worker>()
22+
.Run();
23+
}

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase.Service/Worker.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33

44
namespace MyProjectSchedulerWithDatabase.Service;
55

6-
internal class Worker
6+
internal class Worker(IMyEntityServiceService service)
77
{
8-
private readonly IMyEntityServiceService _service;
9-
10-
public Worker(IMyEntityServiceService service) => _service = service;
11-
128
public async Task Run()
139
{
14-
var items = await _service.GetAllAsync();
10+
var items = await service.GetAllAsync();
1511

1612
// TODO
1713
}
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31019.35
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34902.65
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Service", "MyProjectSchedulerWithDatabase.Service\MyProjectSchedulerWithDatabase.Service.csproj", "{74EA86C6-ECF6-4848-9578-A4A40D3C5AFD}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase", "MyProjectSchedulerWithDatabase\MyProjectSchedulerWithDatabase.csproj", "{D98D043C-B707-458E-A946-D671FD60D04C}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase", "MyProjectSchedulerWithDatabase\MyProjectSchedulerWithDatabase.csproj", "{C3826D09-5DA8-4DA2-A49A-4D32D9E3914B}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Database", "MyProjectSchedulerWithDatabase.Database\MyProjectSchedulerWithDatabase.Database.csproj", "{E5AE1DB4-39E5-4570-9FF8-B197D46CB30E}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Database", "MyProjectSchedulerWithDatabase.Database\MyProjectSchedulerWithDatabase.Database.csproj", "{285852CE-3367-453B-B156-7DDEF1FA6643}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Database.SchemaUpdater", "MyProjectSchedulerWithDatabase.Database.SchemaUpdater\MyProjectSchedulerWithDatabase.Database.SchemaUpdater.csproj", "{B3B2F94B-1C37-4821-B3A0-F080DDF387F6}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Database.SchemaUpdater", "MyProjectSchedulerWithDatabase.Database.SchemaUpdater\MyProjectSchedulerWithDatabase.Database.SchemaUpdater.csproj", "{DA774F29-D22B-416F-B92D-F1C795DFF8FD}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyProjectSchedulerWithDatabase.Service", "MyProjectSchedulerWithDatabase.Service\MyProjectSchedulerWithDatabase.Service.csproj", "{73E97F0D-C61E-4D34-AA84-0D8216B51F55}"
1313
EndProject
1414
Global
1515
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16-
Debug|Mixed Platforms = Debug|Mixed Platforms
17-
Release|Mixed Platforms = Release|Mixed Platforms
16+
Debug|Any CPU = Debug|Any CPU
17+
Release|Any CPU = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{74EA86C6-ECF6-4848-9578-A4A40D3C5AFD}.Debug|Mixed Platforms.ActiveCfg = Debug|x64
21-
{74EA86C6-ECF6-4848-9578-A4A40D3C5AFD}.Debug|Mixed Platforms.Build.0 = Debug|x64
22-
{74EA86C6-ECF6-4848-9578-A4A40D3C5AFD}.Release|Mixed Platforms.ActiveCfg = Release|x64
23-
{74EA86C6-ECF6-4848-9578-A4A40D3C5AFD}.Release|Mixed Platforms.Build.0 = Release|x64
24-
{C3826D09-5DA8-4DA2-A49A-4D32D9E3914B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
25-
{C3826D09-5DA8-4DA2-A49A-4D32D9E3914B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
26-
{C3826D09-5DA8-4DA2-A49A-4D32D9E3914B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
27-
{C3826D09-5DA8-4DA2-A49A-4D32D9E3914B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
28-
{285852CE-3367-453B-B156-7DDEF1FA6643}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
29-
{285852CE-3367-453B-B156-7DDEF1FA6643}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
30-
{285852CE-3367-453B-B156-7DDEF1FA6643}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
31-
{285852CE-3367-453B-B156-7DDEF1FA6643}.Release|Mixed Platforms.Build.0 = Release|Any CPU
32-
{DA774F29-D22B-416F-B92D-F1C795DFF8FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
33-
{DA774F29-D22B-416F-B92D-F1C795DFF8FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
34-
{DA774F29-D22B-416F-B92D-F1C795DFF8FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
35-
{DA774F29-D22B-416F-B92D-F1C795DFF8FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
20+
{D98D043C-B707-458E-A946-D671FD60D04C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{D98D043C-B707-458E-A946-D671FD60D04C}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{D98D043C-B707-458E-A946-D671FD60D04C}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{D98D043C-B707-458E-A946-D671FD60D04C}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{E5AE1DB4-39E5-4570-9FF8-B197D46CB30E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{E5AE1DB4-39E5-4570-9FF8-B197D46CB30E}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{E5AE1DB4-39E5-4570-9FF8-B197D46CB30E}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{E5AE1DB4-39E5-4570-9FF8-B197D46CB30E}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{B3B2F94B-1C37-4821-B3A0-F080DDF387F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{B3B2F94B-1C37-4821-B3A0-F080DDF387F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{B3B2F94B-1C37-4821-B3A0-F080DDF387F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{B3B2F94B-1C37-4821-B3A0-F080DDF387F6}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{73E97F0D-C61E-4D34-AA84-0D8216B51F55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{73E97F0D-C61E-4D34-AA84-0D8216B51F55}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{73E97F0D-C61E-4D34-AA84-0D8216B51F55}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{73E97F0D-C61E-4D34-AA84-0D8216B51F55}.Release|Any CPU.Build.0 = Release|Any CPU
3636
EndGlobalSection
3737
GlobalSection(SolutionProperties) = preSolution
3838
HideSolutionNode = FALSE
3939
EndGlobalSection
4040
GlobalSection(ExtensibilityGlobals) = postSolution
41-
SolutionGuid = {92A88EF4-3AF3-461F-96CC-4EA7685F1947}
41+
SolutionGuid = {94A53EAB-B878-4CAA-B747-BF16E079D277}
4242
EndGlobalSection
4343
EndGlobal
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
22
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DI/@EntryIndexedValue">DI</s:String>
3+
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
34
<s:Boolean x:Key="/Default/UserDictionary/Words/=Registrator/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

src/templates/MyProjectWindowsServiceWithDatabase/MyProjectSchedulerWithDatabase/IMyProjectWindowsServiceWithDatabaseUnitOfWork.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace MyProjectSchedulerWithDatabase;
44

5-
public interface IMyProjectSchedulerWithDatabaseUnitOfWork : ITransactUnitOfWork
6-
{
7-
}
5+
public interface IMyProjectSchedulerWithDatabaseUnitOfWork : ITransactUnitOfWork;

0 commit comments

Comments
 (0)