Skip to content

Commit 1f59421

Browse files
authored
added more async everywhere (#55)
1 parent 35202ee commit 1f59421

42 files changed

Lines changed: 289 additions & 268 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# docker buildx create --driver=docker-container --name=container
44

5-
version="0.17.8"
5+
version="0.18.0"
66
build="mcr.microsoft.com/dotnet/sdk:8.0"
77
base="mcr.microsoft.com/dotnet/aspnet:8.0"
88
name="transformalize.orchard"

src/OrchardCore.BootswatchTheme.Settings/OrchardCore.BootswatchTheme.Settings.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
8-
<Version>0.17.8</Version>
9-
<FileVersion>0.17.8</FileVersion>
10-
<AssemblyVersion>0.17.8</AssemblyVersion>
8+
<Version>0.18.0</Version>
9+
<FileVersion>0.18.0</FileVersion>
10+
<AssemblyVersion>0.18.0</AssemblyVersion>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

src/OrchardCore.BootswatchTheme/OrchardCore.BootswatchTheme.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
8-
<Version>0.17.8</Version>
8+
<Version>0.18.0</Version>
99
<AssemblyName>BootswatchTheme</AssemblyName>
10-
<FileVersion>0.17.8</FileVersion>
11-
<AssemblyVersion>0.17.8</AssemblyVersion>
10+
<FileVersion>0.18.0</FileVersion>
11+
<AssemblyVersion>0.18.0</AssemblyVersion>
1212
</PropertyGroup>
1313

1414
<ItemGroup>

src/OrchardCore.Proxy/Migrations.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ public int Create() {
6868
return 1;
6969
}
7070

71-
private async Task EnableFeature(string id) {
7271

73-
var availableFeatures = await _moduleService.GetAvailableFeaturesAsync();
74-
75-
var contentFields = availableFeatures.FirstOrDefault(f => f.Descriptor.Id == id);
76-
if (contentFields != null) {
77-
if (!contentFields.IsEnabled) {
78-
_logger.LogInformation($"Enabling {id}");
79-
await _moduleService.EnableFeaturesAsync(new[] { id });
80-
}
81-
} else {
82-
_logger.LogError($"Unable to find {id} features required for Proxy.");
83-
}
84-
}
8572
}
8673
}

src/OrchardCore.Proxy/OrchardCore.Proxy.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
66
<RootNamespace>ProxyModule</RootNamespace>
7-
<Version>0.17.8</Version>
8-
<FileVersion>0.17.8</FileVersion>
9-
<AssemblyVersion>0.17.8</AssemblyVersion>
7+
<Version>0.18.0</Version>
8+
<FileVersion>0.18.0</FileVersion>
9+
<AssemblyVersion>0.18.0</AssemblyVersion>
1010
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1111
<Authors>Dale Newman</Authors>
1212
<Copyright>Copyright © 2023-2026</Copyright>
@@ -35,7 +35,7 @@
3535
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="2.2.1" />
3636
<PackageReference Include="OrchardCore.DisplayManagement" Version="2.2.1" />
3737

38-
<PackageReference Include="OrchardCoreContrib.ContentPermissions" Version="1.0.0" />
38+
<PackageReference Include="OrchardCoreContrib.ContentPermissions" Version="1.1.0" />
3939
</ItemGroup>
4040

4141
</Project>

src/OrchardCore.Transformalize/Controllers/ArrangementController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task<ActionResult> TransformalizeParameters(string contentItemId) {
4141
arrangement = item.ContentItem.Content.TransformalizeReportPart.Arrangement.Arrangement.Value;
4242
}
4343

44-
var process = new Process(_modifier.Modify(arrangement, item.ContentItem.Id, _parameterService.GetParameters()));
44+
var process = new Process(await _modifier.ModifyAsync(arrangement, item.ContentItem.Id, _parameterService.GetParameters()));
4545
process.Connections.Clear();
4646

4747
if (item.Fails()) {

src/OrchardCore.Transformalize/Controllers/BulkActionController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public async Task<ActionResult> Create(BulkActionRequest request) {
142142
}
143143

144144
if (request.ActionCount == 0) {
145-
var batchProcess = _reportService.LoadForBatch(report.ContentItem);
145+
var batchProcess = await _reportService.LoadForBatchAsync(report.ContentItem);
146146

147147
await _taskService.RunAsync(batchProcess);
148148
foreach (var batchRow in batchProcess.Entities.First().Rows) {

src/OrchardCore.Transformalize/Controllers/FormController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task<ActionResult> Index(string contentItemId) {
5757
return View(form);
5858
}
5959

60-
var scope = _container.CreateScope(form.Process, _logger, null);
60+
var scope = await _container.CreateScopeAsync(form.Process, _logger, null);
6161

6262
if (!scope.IsRegistered<AdoFormCommandWriter>()) {
6363
_logger.Error(() => "The form command writer isn't registered.");

src/OrchardCore.Transformalize/Drivers/TransformalizeFormPartDisplayDriver.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ ISettingsService settings
4848
_settings = settings;
4949
}
5050

51-
public override IDisplayResult Edit(TransformalizeFormPart part, BuildPartEditorContext context) {
51+
public override async Task<IDisplayResult> EditAsync(TransformalizeFormPart part, BuildPartEditorContext context) {
5252

5353
var commands = new AdoFormCommands();
54-
var process = _configurationContainer.CreateScope(part.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false).Resolve<Process>();
54+
var initial = await _configurationContainer.CreateScopeAsync(part.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false);
55+
var process = initial.Resolve<Process>();
5556

5657
_settings.ApplyCommonSettings(process);
5758

58-
using (var scope = _container.CreateScope(process, _logger, null)) {
59+
await using (var scope = await _container.CreateScopeAsync(process, _logger, null)) {
5960
if (scope.IsRegistered<AdoFormCommandWriter>()) {
6061
commands = scope.Resolve<AdoFormCommandWriter>().Write();
6162
}
@@ -89,7 +90,8 @@ public override async Task<IDisplayResult> UpdateAsync(TransformalizeFormPart pa
8990

9091
try {
9192
var logger = new MemoryLogger(LogLevel.Error);
92-
var process = _configurationContainer.CreateScope(model.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false).Resolve<Process>();
93+
var final = await _configurationContainer.CreateScopeAsync(model.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false);
94+
var process = final.Resolve<Process>();
9395
if (process.Errors().Any()) {
9496
foreach (var error in process.Errors()) {
9597
context.Updater.ModelState.AddModelError(Prefix, S[error]);

src/OrchardCore.Transformalize/Drivers/TransformalizeReportPartDisplayDriver.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public override async Task<IDisplayResult> UpdateAsync(TransformalizeReportPart
136136

137137
try {
138138
var logger = new MemoryLogger(LogLevel.Error);
139-
var process = _container.CreateScope(model.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false).Resolve<Process>();
139+
var scope = await _container.CreateScopeAsync(model.Arrangement.Text, part.ContentItem, new Dictionary<string, string>(), false);
140+
var process = scope.Resolve<Process>();
140141
if (process.Errors().Any()) {
141142
foreach (var error in process.Errors()) {
142143
context.Updater.ModelState.AddModelError(Prefix, S[error]);

0 commit comments

Comments
 (0)