Skip to content

Commit 98c49ad

Browse files
authored
Merge pull request #217 from digipost/upgrade_xscgen
Upgrade xscgen, net6.0 and kaizen
2 parents a518f56 + e36a59e commit 98c49ad

File tree

38 files changed

+1301
-1206
lines changed

38 files changed

+1301
-1206
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"dotnet-xscgen": {
6-
"version": "2.0.594",
6+
"version": "2.1.963",
77
"commands": [
88
"xscgen"
99
]

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v3
12-
- name: Setup .NET Core
11+
- uses: actions/checkout@v4
12+
- name: Setup .NET
1313
uses: actions/setup-dotnet@v3
1414
with:
15-
dotnet-version: 3.1.101
15+
dotnet-version: 6.x
1616
- name: Print openssl version
1717
run: |
1818
openssl version

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
13-
- name: Setup .NET Core
12+
- uses: actions/checkout@v4
13+
- name: Setup .NET
1414
uses: actions/setup-dotnet@v3
1515
with:
16-
dotnet-version: 3.1.101
16+
dotnet-version: 6.x
1717
- name: Print openssl version
1818
run: |
1919
openssl version

Digipost.Api.Client.Archive.Tests/DataTransferObjectConverterTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using Digipost.Api.Client.Common;
33
using Digipost.Api.Client.Tests.CompareObjects;
4-
using V8;
4+
using V8 = Digipost.Api.Client.Common.Generated.V8;
55
using Xunit;
66

77
namespace Digipost.Api.Client.Archive.Tests
@@ -18,7 +18,7 @@ public void Archive()
1818
var source = new V8.Archive()
1919
{
2020
Name = "per",
21-
Sender_Id = 1010,
21+
SenderId = 1010,
2222
};
2323

2424
var expected = new Archive(new Sender(1010), "per");
@@ -32,14 +32,14 @@ public void Archive()
3232
public void ArchiveDocumentBasicState()
3333
{
3434
var newGuid = Guid.NewGuid();
35-
var source = new Archive_Document()
35+
var source = new V8.ArchiveDocument()
3636
{
3737
Uuid = newGuid.ToString(),
38-
File_Name = "per.txt",
39-
File_Type = "txt",
40-
Content_Type = "text/plain",
38+
FileName = "per.txt",
39+
FileType = "txt",
40+
ContentType = "text/plain",
4141
Attributes = { },
42-
Link = {new Link() {Rel = $"{BaseUri}/relations/get_something", Uri = $"{BaseUri}/something", Media_Type = "text/plain"}}
42+
Link = {new V8.Link() {Rel = $"{BaseUri}/relations/get_something", Uri = $"{BaseUri}/something", MediaType = "text/plain"}}
4343
};
4444

4545
var expected = new ArchiveDocument(newGuid, "per.txt", "txt", "text/plain");
@@ -56,13 +56,13 @@ public void ArchiveDocumentToDto()
5656
var newGuid = Guid.NewGuid();
5757
var source = new ArchiveDocument(newGuid, "per.txt", "txt", "text/plain").WithAttribute("test", "val");
5858

59-
var expected = new Archive_Document()
59+
var expected = new V8.ArchiveDocument()
6060
{
6161
Uuid = newGuid.ToString(),
62-
File_Name = "per.txt",
63-
File_Type = "txt",
64-
Content_Type = "text/plain",
65-
Attributes = { new Archive_Document_Attribute(){Key = "test", Value = "val"} },
62+
FileName = "per.txt",
63+
FileType = "txt",
64+
ContentType = "text/plain",
65+
Attributes = { new V8.ArchiveDocumentAttribute(){Key = "test", Value = "val"} },
6666
};
6767

6868
Comparator.AssertEqual(expected, source.ToDataTransferObject());

Digipost.Api.Client.Archive.Tests/Digipost.Api.Client.Archive.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<SignAssembly>true</SignAssembly>
55
<AssemblyOriginatorKeyFile>..\signingkey.snk</AssemblyOriginatorKeyFile>
6-
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<TargetFramework>net6.0</TargetFramework>
77
<RootNamespace>Digipost.Api.Client.Archive.Tests</RootNamespace>
88
<AssemblyName>Digipost.Api.Client.Archive.Tests</AssemblyName>
99
<ProjectGuid>{c22f80a7-08e5-4836-9e24-e7bb431e9a5d}</ProjectGuid>

Digipost.Api.Client.Archive/ArchiveApi.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Digipost.Api.Client.Common.Relations;
99
using Digipost.Api.Client.Common.Utilities;
1010
using Microsoft.Extensions.Logging;
11-
using V8;
11+
using V8 = Digipost.Api.Client.Common.Generated.V8;
1212

1313
namespace Digipost.Api.Client.Archive
1414
{
@@ -68,14 +68,14 @@ internal ArchiveApi(RequestHelper requestHelper, ILoggerFactory loggerFactory, R
6868
public async Task<IEnumerable<Archive>> FetchArchives()
6969
{
7070
var archivesUri = _root.GetGetArchivesUri();
71-
var archives = await _requestHelper.Get<Archives>(archivesUri).ConfigureAwait(false);
71+
var archives = await _requestHelper.Get<V8.Archives>(archivesUri).ConfigureAwait(false);
7272

7373
return archives.Archive.Select(ArchiveDataTransferObjectConverter.FromDataTransferObject);
7474
}
7575

7676
public async Task<IEnumerable<Archive>> FetchArchiveDocumentsByReferenceId(string referenceId)
7777
{
78-
var archives = await _requestHelper.Get<Archives>(_root.GetGetArchiveDocumentsReferenceIdUri(referenceId)).ConfigureAwait(false);
78+
var archives = await _requestHelper.Get<V8.Archives>(_root.GetGetArchiveDocumentsReferenceIdUri(referenceId)).ConfigureAwait(false);
7979

8080
return archives.Archive.Select(ArchiveDataTransferObjectConverter.FromDataTransferObject);
8181
}
@@ -104,7 +104,7 @@ public async Task<ArchiveDocument> UpdateDocument(ArchiveDocument archiveDocumen
104104
var messageAction = new ArchiveDocumentAction(archiveDocument);
105105
var httpContent = messageAction.Content(archiveDocument);
106106

107-
var updatedArchiveDocument = _requestHelper.Put<Archive_Document>(httpContent, messageAction.RequestContent, updateUri);
107+
var updatedArchiveDocument = _requestHelper.Put<V8.ArchiveDocument>(httpContent, messageAction.RequestContent, updateUri);
108108

109109
if (updatedArchiveDocument.IsFaulted && updatedArchiveDocument.Exception != null)
110110
throw updatedArchiveDocument.Exception?.InnerException;
@@ -183,7 +183,7 @@ public async Task<Stream> StreamDocument(ArchiveDocumentContentStreamUri documen
183183

184184
public async Task<ArchiveDocumentContent> GetDocumentContent(ArchiveDocumentContentUri archiveDocumentContentUri)
185185
{
186-
var result = await _requestHelper.Get<Archive_Document_Content>(archiveDocumentContentUri).ConfigureAwait(false);
186+
var result = await _requestHelper.Get<V8.ArchiveDocumentContent>(archiveDocumentContentUri).ConfigureAwait(false);
187187

188188
return result.FromDataTransferObject();
189189
}
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Linq;
33
using Digipost.Api.Client.Common;
4-
using V8;
4+
using V8 = Digipost.Api.Client.Common.Generated.V8;
55

66
namespace Digipost.Api.Client.Archive
77
{
@@ -12,8 +12,8 @@ internal static V8.Archive ToDataTransferObject(this Archive a)
1212
var dto = new V8.Archive()
1313
{
1414
Name = a.Name,
15-
Sender_Id = a.Sender.Id,
16-
Sender_IdSpecified = true
15+
SenderId = a.Sender.Id,
16+
SenderIdSpecified = true
1717
};
1818

1919
foreach (var ad in a.ArchiveDocuments.Select(ToDataTransferObject))
@@ -24,66 +24,66 @@ internal static V8.Archive ToDataTransferObject(this Archive a)
2424
return dto;
2525
}
2626

27-
internal static Archive_Document ToDataTransferObject(this ArchiveDocument ad)
27+
internal static V8.ArchiveDocument ToDataTransferObject(this ArchiveDocument ad)
2828
{
29-
var dto = new Archive_Document()
29+
var dto = new V8.ArchiveDocument()
3030
{
3131
Uuid = ad.Id.ToString(),
32-
File_Name = ad.FileName,
33-
File_Type = ad.FileType,
34-
Content_Type = ad.ContentType,
32+
FileName = ad.FileName,
33+
FileType = ad.FileType,
34+
ContentType = ad.ContentType,
3535
Referenceid = ad.ReferenceId,
36-
Archived_Time = ad.ArchiveTime,
37-
Deletion_Time = ad.DeletionTime
36+
ArchivedTime = ad.ArchiveTime,
37+
DeletionTime = ad.DeletionTime
3838
};
3939

4040
foreach (var attribute in ad.Attributes)
4141
{
42-
dto.Attributes.Add(new Archive_Document_Attribute(){Key = attribute.Key, Value = attribute.Value});
42+
dto.Attributes.Add(new V8.ArchiveDocumentAttribute(){Key = attribute.Key, Value = attribute.Value});
4343
}
4444

4545
if (ad.ContentHash != null)
4646
{
47-
dto.Content_Hash = new Content_Hash()
47+
dto.ContentHash = new V8.ContentHash()
4848
{
4949
Value = ad.ContentHash.Value,
50-
Hash_Algorithm = ad.ContentHash.HashAlgoritm
50+
HashAlgorithm = ad.ContentHash.HashAlgoritm
5151
};
5252
}
5353

5454
return dto;
5555
}
5656

57-
internal static ArchiveDocument FromDataTransferObject(this Archive_Document ad)
57+
internal static ArchiveDocument FromDataTransferObject(this V8.ArchiveDocument ad)
5858
{
5959
return new ArchiveDocument(
6060
new Guid(ad.Uuid),
61-
ad.File_Name,
62-
ad.File_Type,
63-
ad.Content_Type
61+
ad.FileName,
62+
ad.FileType,
63+
ad.ContentType
6464
)
6565
{
6666
ReferenceId = ad.Referenceid,
67-
ContentHash = ad.Content_Hash == null ? null : new ContentHash {HashAlgoritm = ad.Content_Hash.Hash_Algorithm, Value = ad.Content_Hash.Value},
68-
ArchiveTime = ad.Archived_Time,
69-
DeletionTime = ad.Deletion_Time,
67+
ContentHash = ad.ContentHash == null ? null : new ContentHash {HashAlgoritm = ad.ContentHash.HashAlgorithm, Value = ad.ContentHash.Value},
68+
ArchiveTime = ad.ArchivedTime,
69+
DeletionTime = ad.DeletionTime,
7070
Attributes = ad.Attributes.ToDictionary(ada => ada.Key, ada => ada.Value),
7171
Links = ad.Link.FromDataTransferObject()
7272
};
7373
}
7474

7575
internal static Archive FromDataTransferObject(this V8.Archive a)
7676
{
77-
return new Archive(new Sender(a.Sender_Id), a.Name)
77+
return new Archive(new Sender(a.SenderId), a.Name)
7878
{
7979
ArchiveDocuments = a.Documents.Select(FromDataTransferObject).ToList(),
8080
Links = a.Link.FromDataTransferObject()
8181
};
8282
}
8383

84-
internal static ArchiveDocumentContent FromDataTransferObject(this Archive_Document_Content result)
84+
internal static ArchiveDocumentContent FromDataTransferObject(this V8.ArchiveDocumentContent result)
8585
{
86-
return new ArchiveDocumentContent(result.Content_Type, new Uri(result.Uri, UriKind.Absolute));
86+
return new ArchiveDocumentContent(result.ContentType, new Uri(result.Uri, UriKind.Absolute));
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)