Implementiere WithMessage und WithMessageKey Methoden in IServiceMessage
Methoden hinzugefügt, um Nachrichten direkt oder über Enum-Schlüssel hinzuzufügen, unterstützt Methodenverkettung in IServiceMessage.
This commit is contained in:
parent
f0b778abf0
commit
124fe0787b
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
# Exclude files
|
||||
*.swp
|
||||
*.*~
|
||||
project.lock.json
|
||||
*.lock.json
|
||||
*.lock
|
||||
Dockerfile.*.cache
|
||||
duplicati-*
|
||||
|
||||
# Build and runtime outputs
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
*.snupkg
|
||||
|
||||
# packages/
|
||||
|
||||
# VS Code settings
|
||||
.vscode/
|
||||
|
||||
# Tools and utilities
|
||||
BIN
.vs/DigitalData.Core/DesignTimeBuild/.dtbcache.v2
Normal file
BIN
.vs/DigitalData.Core/DesignTimeBuild/.dtbcache.v2
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.vs/DigitalData.Core/v17/.futdcache.v2
Normal file
BIN
.vs/DigitalData.Core/v17/.futdcache.v2
Normal file
Binary file not shown.
BIN
.vs/DigitalData.Core/v17/.suo
Normal file
BIN
.vs/DigitalData.Core/v17/.suo
Normal file
Binary file not shown.
BIN
.vs/DigitalData.Core/v17/TestStore/0/000.testlog
Normal file
BIN
.vs/DigitalData.Core/v17/TestStore/0/000.testlog
Normal file
Binary file not shown.
BIN
.vs/DigitalData.Core/v17/TestStore/0/testlog.manifest
Normal file
BIN
.vs/DigitalData.Core/v17/TestStore/0/testlog.manifest
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -29,5 +29,28 @@ namespace DigitalData.Core.Application
|
||||
/// Gets or sets a collection of messages associated with the service operation.
|
||||
/// </summary>
|
||||
public List<string> Messages { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new message to the collection of messages associated with the service operation.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to add.</param>
|
||||
/// <returns>The current instance of ServiceMessage, allowing for method chaining.</returns>
|
||||
public IServiceMessage WithMessage(string message)
|
||||
{
|
||||
Messages.Add(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a message corresponding to the specified message key to the collection of messages associated with the service operation.
|
||||
/// This method uses the string representation of the enum value as the message.
|
||||
/// </summary>
|
||||
/// <param name="messageKey">The enum value representing the message key.</param>
|
||||
/// <returns>The current instance of ServiceMessage, allowing for method chaining.</returns>
|
||||
public IServiceMessage WithMessageKey(Enum messageKey)
|
||||
{
|
||||
Messages.Add(messageKey.ToString());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -32,7 +32,8 @@
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.cryptography.cng\\5.0.0\\system.security.cryptography.cng.5.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.cryptography.protecteddata\\7.0.0\\system.security.cryptography.protecteddata.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.permissions\\7.0.0\\system.security.permissions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512"
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\webcore.contracts\\1.0.1\\webcore.contracts.1.0.1.nupkg.sha512"
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
|
||||
@ -17,5 +17,20 @@
|
||||
/// success notifications, or other relevant information related to the operation's outcome.
|
||||
/// </summary>
|
||||
List<string> Messages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new message to the collection of service messages.
|
||||
/// </summary>
|
||||
/// <param name="message">The message to add.</param>
|
||||
/// <returns>The current instance of IServiceMessage, allowing for method chaining.</returns>
|
||||
IServiceMessage WithMessage(string message);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a message corresponding to the specified message key to the collection of service messages.
|
||||
/// This method uses the string representation of the enum value as the message.
|
||||
/// </summary>
|
||||
/// <param name="messageKey">The enum value representing the message key.</param>
|
||||
/// <returns>The current instance of IServiceMessage, allowing for method chaining.</returns>
|
||||
IServiceMessage WithMessageKey(Enum messageKey);
|
||||
}
|
||||
}
|
||||
12
DigitalData.Core.Contracts/Properties/launchSettings.json
Normal file
12
DigitalData.Core.Contracts/Properties/launchSettings.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"profiles": {
|
||||
"DigitalData.Core.Contracts": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "https://localhost:50074;http://localhost:50075"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -28,7 +28,8 @@
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.1\\system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.cryptography.protecteddata\\7.0.0\\system.security.cryptography.protecteddata.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.permissions\\7.0.0\\system.security.permissions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512"
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\webcore.contracts\\1.0.1\\webcore.contracts.1.0.1.nupkg.sha512"
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -31,7 +31,8 @@
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.identitymodel.tokens.jwt\\7.5.1\\system.identitymodel.tokens.jwt.7.5.1.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.cryptography.protecteddata\\7.0.0\\system.security.cryptography.protecteddata.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.security.permissions\\7.0.0\\system.security.permissions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512"
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\system.windows.extensions\\7.0.0\\system.windows.extensions.7.0.0.nupkg.sha512",
|
||||
"C:\\Users\\tekh\\.nuget\\packages\\webcore.contracts\\1.0.1\\webcore.contracts.1.0.1.nupkg.sha512"
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user