diff --git a/src/Communication.Abstractions/Dgmjr.AspNetCore.Communication.Abstractions.sln b/src/Communication.Abstractions/Dgmjr.AspNetCore.Communication.Abstractions.sln
deleted file mode 100644
index 04d4675c..00000000
--- a/src/Communication.Abstractions/Dgmjr.AspNetCore.Communication.Abstractions.sln
+++ /dev/null
@@ -1,42 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-#
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}"
- ProjectSection(SolutionItems) = preProject
- ..\..\Directory.Build.props = ..\..\Directory.Build.props
- ..\..\..\..\Directory.Build.targets = ..\..\..\..\Directory.Build.targets
- ..\..\..\..\global.json = ..\..\..\..\global.json
- ..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\Packages\Versions.Local.props
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.AspNetCore.Communication.Abstractions", "Dgmjr.AspNetCore.Communication.Abstractions.csproj", "{3B567DE2-8008-43B6-B04C-20586C7F30CF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Local|Any CPU = Local|Any CPU
- Debug|Any CPU = Debug|Any CPU
- Testing|Any CPU = Testing|Any CPU
- Staging|Any CPU = Staging|Any CPU
- Production|Any CPU = Production|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Local|Any CPU.ActiveCfg = Local|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Local|Any CPU.Build.0 = Local|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Testing|Any CPU.Build.0 = Testing|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Staging|Any CPU.Build.0 = Staging|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Production|Any CPU.ActiveCfg = Local|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Production|Any CPU.Build.0 = Local|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3B567DE2-8008-43B6-B04C-20586C7F30CF}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {F12DE833-DBD0-4D15-B0CC-14B581964C28}
- EndGlobalSection
-EndGlobal
diff --git a/src/Communication/.vscode/settings.json b/src/Communication/.vscode/settings.json
new file mode 100644
index 00000000..9d904b84
--- /dev/null
+++ b/src/Communication/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "sonarlint.connectedMode.project": {
+ "connectionId": "dgmjr-io",
+ "projectKey": "dgmjr-io_Dgmjr.Communication"
+ }
+}
\ No newline at end of file
diff --git a/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.csproj b/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.csproj
new file mode 100644
index 00000000..84b8b932
--- /dev/null
+++ b/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.csproj
@@ -0,0 +1,21 @@
+
+
+
+
+ $(TargetedDotNetFrameworks)
+
+
+
+
+
+
diff --git a/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.sln b/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.sln
new file mode 100644
index 00000000..b7b7eab6
--- /dev/null
+++ b/src/Communication/All/Dgmjr.Azure.CommunicationServices.All.sln
@@ -0,0 +1,70 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+#
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\..\Directory.Build.props = ..\..\..\Directory.Build.props
+ ..\..\..\..\..\Directory.Build.targets = ..\..\..\..\..\Directory.Build.targets
+ ..\..\..\..\..\global.json = ..\..\..\..\..\global.json
+ ..\..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\..\Packages\Versions.Local.props
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices", "..\Communcation\Dgmjr.Azure.CommunicationServices.csproj", "{3D36177C-5640-4BA3-86FD-7E73A849EC55}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices.Abstractions", "..\Communication.Abstractions\Dgmjr.Azure.CommunicationServices.Abstractions.csproj", "{8C663B7A-804D-457E-ADCB-5AAF9390387F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices.All", "Dgmjr.Azure.CommunicationServices.All.csproj", "{F8812B66-F966-497B-9777-752226D538FC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Local|Any CPU = Local|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Testing|Any CPU = Testing|Any CPU
+ Staging|Any CPU = Staging|Any CPU
+ Production|Any CPU = Production|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Local|Any CPU.Build.0 = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Production|Any CPU.Build.0 = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Local|Any CPU.Build.0 = Local|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Production|Any CPU.Build.0 = Local|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8C663B7A-804D-457E-ADCB-5AAF9390387F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Local|Any CPU.Build.0 = Local|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Production|Any CPU.Build.0 = Local|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F8812B66-F966-497B-9777-752226D538FC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {BA9DF526-DE32-44E2-A6AB-12A4E855F480}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Communication.Abstractions/LICENSE.md b/src/Communication/All/LICENSE.md
similarity index 100%
rename from src/Communication.Abstractions/LICENSE.md
rename to src/Communication/All/LICENSE.md
diff --git a/src/Communication/All/icon.png b/src/Communication/All/icon.png
new file mode 100644
index 00000000..df642aaf
Binary files /dev/null and b/src/Communication/All/icon.png differ
diff --git a/src/Communication/AzureCommunicationServicesAutoConfigurator.cs b/src/Communication/Communcation/AzureCommunicationServicesAutoConfigurator.cs
similarity index 96%
rename from src/Communication/AzureCommunicationServicesAutoConfigurator.cs
rename to src/Communication/Communcation/AzureCommunicationServicesAutoConfigurator.cs
index 3de996e6..88e54e11 100644
--- a/src/Communication/AzureCommunicationServicesAutoConfigurator.cs
+++ b/src/Communication/Communcation/AzureCommunicationServicesAutoConfigurator.cs
@@ -48,7 +48,7 @@ public void Configure(IApplicationBuilder builder)
}
}
- public void Configure(IHostApplicationBuilder builder)
+ public void Configure(WebApplicationBuilder builder)
{
var optionsSection = builder.Configuration.GetSection(
AzureCommunicationServicesOptionsBase.ConfigurationSectionName
diff --git a/src/Communication/AzureCommunicationServicesOptions.cs b/src/Communication/Communcation/AzureCommunicationServicesOptions.cs
similarity index 100%
rename from src/Communication/AzureCommunicationServicesOptions.cs
rename to src/Communication/Communcation/AzureCommunicationServicesOptions.cs
diff --git a/src/Communication/Dgmjr.AspNetCore.Communication.csproj b/src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.csproj
similarity index 86%
rename from src/Communication/Dgmjr.AspNetCore.Communication.csproj
rename to src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.csproj
index 73cbf1a5..9d37bc79 100644
--- a/src/Communication/Dgmjr.AspNetCore.Communication.csproj
+++ b/src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.csproj
@@ -16,6 +16,7 @@
comms
true
$(TargetedDotNetFrameworks)
+ 3d36177c-5640-4ba3-86fd-7e73a849ec55
@@ -24,16 +25,19 @@
-
-
-
+
-
+
+
+
+
+
+
diff --git a/src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.sln b/src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.sln
new file mode 100644
index 00000000..b96e1774
--- /dev/null
+++ b/src/Communication/Communcation/Dgmjr.Azure.CommunicationServices.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+#
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\..\Directory.Build.props = ..\..\..\Directory.Build.props
+ ..\..\..\..\..\Directory.Build.targets = ..\..\..\..\..\Directory.Build.targets
+ ..\..\..\..\..\global.json = ..\..\..\..\..\global.json
+ ..\..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\..\Packages\Versions.Local.props
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices.Abstractions", "..\Communication.Abstractions\Dgmjr.Azure.CommunicationServices.Abstractions.csproj", "{0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices", "Dgmjr.Azure.CommunicationServices.csproj", "{3D36177C-5640-4BA3-86FD-7E73A849EC55}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Local|Any CPU = Local|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Testing|Any CPU = Testing|Any CPU
+ Staging|Any CPU = Staging|Any CPU
+ Production|Any CPU = Production|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Local|Any CPU.Build.0 = Local|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Production|Any CPU.Build.0 = Local|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0A4E64AB-8215-49F8-A5E9-64DA4BF48C87}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Local|Any CPU.Build.0 = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Production|Any CPU.Build.0 = Local|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3D36177C-5640-4BA3-86FD-7E73A849EC55}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {991D96AC-24E8-4358-9F0C-99BE9D5C3BE5}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Communication/Email/EmailSender.cs b/src/Communication/Communcation/Email/EmailSender.cs
similarity index 100%
rename from src/Communication/Email/EmailSender.cs
rename to src/Communication/Communcation/Email/EmailSender.cs
diff --git a/src/Communication/Email/EmailSenderOptions.cs b/src/Communication/Communcation/Email/EmailSenderOptions.cs
similarity index 88%
rename from src/Communication/Email/EmailSenderOptions.cs
rename to src/Communication/Communcation/Email/EmailSenderOptions.cs
index 018258d7..736a93d5 100644
--- a/src/Communication/Email/EmailSenderOptions.cs
+++ b/src/Communication/Communcation/Email/EmailSenderOptions.cs
@@ -22,7 +22,8 @@ public record class EmailSenderOptions : AzureCommunicationServicesOptions options)
: base(options)
{
@@ -51,11 +50,9 @@ public EmailSenderOptions(AzureCommunicationServicesOptions option
SecurityFrom = options.SecurityFrom;
}
- [SetsRequiredMembers]
public EmailSenderOptions(string connectionString, EmailAddress? defaultFrom = null)
: this(Parse(connectionString) with { DefaultFrom = defaultFrom ?? EmailAddress.Empty }) { }
- [SetsRequiredMembers]
public EmailSenderOptions(string endpoint, string accessKey, EmailAddress? defaultFrom = null)
{
DefaultFrom = defaultFrom ?? EmailAddress.Empty;
@@ -63,7 +60,9 @@ public EmailSenderOptions(string endpoint, string accessKey, EmailAddress? defau
AccessKey = accessKey;
}
- [SetsRequiredMembers]
public EmailSenderOptions()
: this(EmptyValue) { }
+
+ public IDictionary Addresses { get; set; } =
+ new Dictionary();
}
diff --git a/src/Communication/Email/MailSendResult.cs b/src/Communication/Communcation/Email/MailSendResult.cs
similarity index 59%
rename from src/Communication/Email/MailSendResult.cs
rename to src/Communication/Communcation/Email/MailSendResult.cs
index 6e1d8020..749937c5 100644
--- a/src/Communication/Email/MailSendResult.cs
+++ b/src/Communication/Communcation/Email/MailSendResult.cs
@@ -1,18 +1,19 @@
namespace Dgmjr.AspNetCore.Communication.Email;
+using System.Runtime.CompilerServices;
+
///
/// Represents the result of sending an email.
///
-public readonly record struct MailSendResult : IMailSendResult
+public readonly record struct MailSendResult(Azure.Communication.Email.EmailSendResult result)
+ : IMailSendResult
{
///
/// Gets or sets the response code of the email send result.
///
- public Abstractions.IMailSendResponseCode Status
- {
- get => MailSendResponseCode.FromId(StatusCode)!;
- init => StatusCode = ((IIdentifiable)value).Id;
- }
+ public Abstractions.IMailSendResponseCode Status => MailSendResponseCode.Parse(StatusName);
+
+ public string StatusName => result.Status.ToString();
///
/// Gets a value indicating whether the email send operation was successful.
@@ -24,5 +25,5 @@ public Abstractions.IMailSendResponseCode Status
///
/// Gets or sets the status code of the email send result.
///
- public int StatusCode { get; init; }
+ public int StatusCode => ((IIdentifiable)Status).Id;
}
diff --git a/src/Communication/LICENSE.md b/src/Communication/Communcation/LICENSE.md
similarity index 100%
rename from src/Communication/LICENSE.md
rename to src/Communication/Communcation/LICENSE.md
diff --git a/src/Communication/Communcation/Sms/SmsSendResult.cs b/src/Communication/Communcation/Sms/SmsSendResult.cs
new file mode 100644
index 00000000..026b8e4c
--- /dev/null
+++ b/src/Communication/Communcation/Sms/SmsSendResult.cs
@@ -0,0 +1,34 @@
+namespace Dgmjr.AspNetCore.Communication.Sms;
+
+///
+/// Represents the result of sending an SMS message.
+///
+public readonly record struct SmsSendResult(Azure.Communication.Sms.SmsSendResult result)
+ : ISmsSendResult
+{
+ // public SmsSendResult
+ // {
+ // StatusCode = result.HttpStatusCode;
+ // ErrorMessage = result.ErrorMessage;
+ // To = (PhoneNumber)result.To;
+ // }
+
+ public string? ErrorMessage => result.ErrorMessage;
+ public PhoneNumber To => (PhoneNumber)result.To;
+
+ ///
+ /// Gets the status code of the message send result.
+ ///
+ public int StatusCode => result.HttpStatusCode;
+
+ ///
+ /// Gets a value indicating whether the SMS message was sent successfully.
+ ///
+ public bool IsSuccess =>
+ StatusCode is SmsSendResponseCode.Success.Id or SmsSendResponseCode.Accepted.Id;
+
+ ///
+ /// Gets or sets the response code of the SMS send result.
+ ///
+ public Abstractions.ISmsSendResponseCode Status => SmsSendResponseCode.FromId(StatusCode);
+}
diff --git a/src/Communication/Sms/SmsSender.cs b/src/Communication/Communcation/Sms/SmsSender.cs
similarity index 100%
rename from src/Communication/Sms/SmsSender.cs
rename to src/Communication/Communcation/Sms/SmsSender.cs
diff --git a/src/Communication/Sms/SmsSenderOptions.cs b/src/Communication/Communcation/Sms/SmsSenderOptions.cs
similarity index 91%
rename from src/Communication/Sms/SmsSenderOptions.cs
rename to src/Communication/Communcation/Sms/SmsSenderOptions.cs
index 43969970..0c6593ba 100644
--- a/src/Communication/Sms/SmsSenderOptions.cs
+++ b/src/Communication/Communcation/Sms/SmsSenderOptions.cs
@@ -62,4 +62,7 @@ public SmsSenderOptions(string connectionString, PhoneNumber? fromPhoneNumber)
{
DefaultFrom = fromPhoneNumber.HasValue ? fromPhoneNumber.Value : PhoneNumber.Empty;
}
+
+ public IDictionary Numbers { get; set; } =
+ new Dictionary();
}
diff --git a/src/Communication/Communcation/icon.png b/src/Communication/Communcation/icon.png
new file mode 100644
index 00000000..df642aaf
Binary files /dev/null and b/src/Communication/Communcation/icon.png differ
diff --git a/src/Communication.Abstractions/Dgmjr.AspNetCore.Communication.Abstractions.csproj b/src/Communication/Communication.Abstractions/Dgmjr.Azure.CommunicationServices.Abstractions.csproj
similarity index 100%
rename from src/Communication.Abstractions/Dgmjr.AspNetCore.Communication.Abstractions.csproj
rename to src/Communication/Communication.Abstractions/Dgmjr.Azure.CommunicationServices.Abstractions.csproj
diff --git a/src/Communication/Communication.Abstractions/Dgmjr.Azure.CommunicationServices.Abstractions.sln b/src/Communication/Communication.Abstractions/Dgmjr.Azure.CommunicationServices.Abstractions.sln
new file mode 100644
index 00000000..e97b9fd3
--- /dev/null
+++ b/src/Communication/Communication.Abstractions/Dgmjr.Azure.CommunicationServices.Abstractions.sln
@@ -0,0 +1,42 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+#
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\..\Directory.Build.props = ..\..\..\Directory.Build.props
+ ..\..\..\..\..\Directory.Build.targets = ..\..\..\..\..\Directory.Build.targets
+ ..\..\..\..\..\global.json = ..\..\..\..\..\global.json
+ ..\..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\..\Packages\Versions.Local.props
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.Azure.CommunicationServices.Abstractions", "Dgmjr.Azure.CommunicationServices.Abstractions.csproj", "{26882AB4-6533-4957-9F15-7B966FDEA4BC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Local|Any CPU = Local|Any CPU
+ Debug|Any CPU = Debug|Any CPU
+ Testing|Any CPU = Testing|Any CPU
+ Staging|Any CPU = Staging|Any CPU
+ Production|Any CPU = Production|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Local|Any CPU.ActiveCfg = Local|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Local|Any CPU.Build.0 = Local|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Testing|Any CPU.Build.0 = Testing|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Staging|Any CPU.Build.0 = Staging|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Production|Any CPU.ActiveCfg = Local|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Production|Any CPU.Build.0 = Local|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {26882AB4-6533-4957-9F15-7B966FDEA4BC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {7BD0ECFE-3F2C-4425-AEB8-E2AA398925B1}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Communication.Abstractions/Enums/MailSendReponseCode.cs b/src/Communication/Communication.Abstractions/Enums/MailSendReponseCode.cs
similarity index 58%
rename from src/Communication.Abstractions/Enums/MailSendReponseCode.cs
rename to src/Communication/Communication.Abstractions/Enums/MailSendReponseCode.cs
index 25533e38..3bf56a05 100644
--- a/src/Communication.Abstractions/Enums/MailSendReponseCode.cs
+++ b/src/Communication/Communication.Abstractions/Enums/MailSendReponseCode.cs
@@ -13,9 +13,27 @@ namespace Dgmjr.AspNetCore.Communication.Email.Enums;
[GenerateEnumerationRecordStruct("MailSendResponseCode", "Dgmjr.AspNetCore.Communication.Email")]
public enum MailSendResponseCode
{
+ [Display(
+ Name = "Succeeded",
+ Description = "The request was successful and the message has been queued for delivery."
+ )]
Succeeded = 200,
+
+ [Display(
+ Name = "Accepted",
+ Description = "The request was successful and the message has been accepted to be queued for delivery."
+ )]
NotStarted = 201,
+
+ [Display(
+ Name = "Running",
+ Description = "The request is running and the message is being sent"
+ )]
Running = 202,
+
+ [Display(Name = "Cancelled", Description = "The request has been cancelled.")]
Canceled = 406,
+
+ [Display(Name = "Failed", Description = "The request failed.")]
Failed = 500
}
diff --git a/src/Communication.Abstractions/Enums/SmsSendResponseCode.cs b/src/Communication/Communication.Abstractions/Enums/SmsSendResponseCode.cs
similarity index 62%
rename from src/Communication.Abstractions/Enums/SmsSendResponseCode.cs
rename to src/Communication/Communication.Abstractions/Enums/SmsSendResponseCode.cs
index 446ce9b6..0cf8afce 100644
--- a/src/Communication.Abstractions/Enums/SmsSendResponseCode.cs
+++ b/src/Communication/Communication.Abstractions/Enums/SmsSendResponseCode.cs
@@ -19,35 +19,54 @@ public enum SmsSendResponseCode
///
/// The request was successful and the message has been queued for delivery.
///
+ [Display(
+ Name = "Success",
+ Description = "The request was successful and the message has been queued for delivery."
+ )]
Success = 200,
///
/// The request was successful and the message has been accepted to be queued for delivery.
///
+ [Display(
+ Name = "Accepted",
+ Description = "The request was successful and the message has been accepted to be queued for delivery."
+ )]
Accepted = 250,
///
/// There was a problem with the request, such as invalid parameters or authentication failure.
///
+ [Display(
+ Name = "Bad Request",
+ Description = "There was a problem with the request, such as invalid parameters or authentication failure."
+ )]
BadRequest = 400,
///
/// Authentication failure. The request requires authentication and the provided credentials were incorrect.
///
+ [Display(
+ Name = "Unauthorized",
+ Description = "Authentication failure. The request requires authentication and the provided credentials were incorrect."
+ )]
Unauthorized = 401,
///
/// Access to the requested resource is forbidden.
///
+ [Display(Name = "Forbidden", Description = "Access to the requested resource is forbidden.")]
Forbidden = 403,
///
/// The requested resource could not be found.
///
+ [Display(Name = "Not Found", Description = "The requested resource could not be found.")]
NotFound = 404,
///
/// An internal server error occurred.
///
+ [Display(Name = "Internal Server Error", Description = "An internal server error occurred.")]
InternalServerError = 500
}
diff --git a/src/Communication.Abstractions/IEmailSender.cs b/src/Communication/Communication.Abstractions/IEmailSender.cs
similarity index 100%
rename from src/Communication.Abstractions/IEmailSender.cs
rename to src/Communication/Communication.Abstractions/IEmailSender.cs
diff --git a/src/Communication.Abstractions/IMailSendResult.cs b/src/Communication/Communication.Abstractions/IMailSendResult.cs
similarity index 100%
rename from src/Communication.Abstractions/IMailSendResult.cs
rename to src/Communication/Communication.Abstractions/IMailSendResult.cs
diff --git a/src/Communication.Abstractions/IMessageSendResult.cs b/src/Communication/Communication.Abstractions/IMessageSendResult.cs
similarity index 73%
rename from src/Communication.Abstractions/IMessageSendResult.cs
rename to src/Communication/Communication.Abstractions/IMessageSendResult.cs
index 2987fb72..42f7f679 100644
--- a/src/Communication.Abstractions/IMessageSendResult.cs
+++ b/src/Communication/Communication.Abstractions/IMessageSendResult.cs
@@ -3,11 +3,11 @@ namespace Dgmjr.AspNetCore.Communication;
public interface IMessageSendResult
{
bool IsSuccess { get; }
- int StatusCode { get; init; }
+ int StatusCode { get; }
}
public interface IMessageSendResult : IMessageSendResult
where TStatus : IIdentifiable
{
- TStatus Status { get; init; }
+ TStatus Status { get; }
}
diff --git a/src/Communication.Abstractions/ISmsSendResult.cs b/src/Communication/Communication.Abstractions/ISmsSendResult.cs
similarity index 100%
rename from src/Communication.Abstractions/ISmsSendResult.cs
rename to src/Communication/Communication.Abstractions/ISmsSendResult.cs
diff --git a/src/Communication.Abstractions/ISmsSender.cs b/src/Communication/Communication.Abstractions/ISmsSender.cs
similarity index 100%
rename from src/Communication.Abstractions/ISmsSender.cs
rename to src/Communication/Communication.Abstractions/ISmsSender.cs
diff --git a/src/Communication/Communication.Abstractions/LICENSE.md b/src/Communication/Communication.Abstractions/LICENSE.md
new file mode 100644
index 00000000..4f592f86
--- /dev/null
+++ b/src/Communication/Communication.Abstractions/LICENSE.md
@@ -0,0 +1,35 @@
+---
+date: 2023-07-13T05:44:46:00-05:00Z
+description: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, yadda, yadda, yadda...
+keywords:
+- IP
+- copyright
+- license
+- mit
+permissions:
+- commercial-use
+- modifications
+- distribution
+- private-use
+conditions:
+- include-copyright
+limitations:
+- liability
+- warranty
+lastmod: 2024-01-0T00:39:00.0000+05:00Z
+license: MIT
+slug: mit-license
+title: MIT License
+type: license
+---
+
+# MIT License
+
+## Copyright © 2022-2024 [David G. Moore, Jr.](mailto:david@dgmjr.io "Send Dr. Moore") ([@dgmjr](https://github.com/dgmjr "Contact Dr. Moore on GitHub")), All Rights Reserved
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/src/Communication.Abstractions/MailSendResponseCode.cs b/src/Communication/Communication.Abstractions/MailSendResponseCode.cs
similarity index 100%
rename from src/Communication.Abstractions/MailSendResponseCode.cs
rename to src/Communication/Communication.Abstractions/MailSendResponseCode.cs
diff --git a/src/Communication.Abstractions/README.md b/src/Communication/Communication.Abstractions/README.md
similarity index 100%
rename from src/Communication.Abstractions/README.md
rename to src/Communication/Communication.Abstractions/README.md
diff --git a/src/Communication.Abstractions/SmsSendResponseCode.cs b/src/Communication/Communication.Abstractions/SmsSendResponseCode.cs
similarity index 100%
rename from src/Communication.Abstractions/SmsSendResponseCode.cs
rename to src/Communication/Communication.Abstractions/SmsSendResponseCode.cs
diff --git a/src/Communication/Communication.Abstractions/icon.png b/src/Communication/Communication.Abstractions/icon.png
new file mode 100644
index 00000000..df642aaf
Binary files /dev/null and b/src/Communication/Communication.Abstractions/icon.png differ
diff --git a/src/Communication/Dgmjr.AspNetCore.Communication.sln b/src/Communication/Dgmjr.AspNetCore.Communication.sln
deleted file mode 100644
index 7bacf8b5..00000000
--- a/src/Communication/Dgmjr.AspNetCore.Communication.sln
+++ /dev/null
@@ -1,56 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-#
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B283EBC2-E01F-412D-9339-FD56EF114549}"
- ProjectSection(SolutionItems) = preProject
- ..\..\Directory.Build.props = ..\..\Directory.Build.props
- ..\..\..\..\Directory.Build.targets = ..\..\..\..\Directory.Build.targets
- ..\..\..\..\global.json = ..\..\..\..\global.json
- ..\..\..\..\Packages\Versions.Local.props = ..\..\..\..\Packages\Versions.Local.props
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.AspNetCore.Communication.Abstractions", "..\Communication.Abstractions\Dgmjr.AspNetCore.Communication.Abstractions.csproj", "{A21EC7BB-E229-4D5F-98BE-194738D8505B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dgmjr.AspNetCore.Communication", "Dgmjr.AspNetCore.Communication.csproj", "{A6082934-C897-4FE1-85CA-AFBDB3EDE272}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Local|Any CPU = Local|Any CPU
- Debug|Any CPU = Debug|Any CPU
- Testing|Any CPU = Testing|Any CPU
- Staging|Any CPU = Staging|Any CPU
- Production|Any CPU = Production|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Local|Any CPU.ActiveCfg = Local|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Local|Any CPU.Build.0 = Local|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Testing|Any CPU.Build.0 = Testing|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Staging|Any CPU.Build.0 = Staging|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Production|Any CPU.ActiveCfg = Local|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Production|Any CPU.Build.0 = Local|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A21EC7BB-E229-4D5F-98BE-194738D8505B}.Release|Any CPU.Build.0 = Release|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Local|Any CPU.ActiveCfg = Local|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Local|Any CPU.Build.0 = Local|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Testing|Any CPU.ActiveCfg = Testing|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Testing|Any CPU.Build.0 = Testing|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Staging|Any CPU.ActiveCfg = Staging|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Staging|Any CPU.Build.0 = Staging|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Production|Any CPU.ActiveCfg = Local|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Production|Any CPU.Build.0 = Local|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A6082934-C897-4FE1-85CA-AFBDB3EDE272}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {209DE4E2-342E-4E9E-BC55-C75D87CD1B08}
- EndGlobalSection
-EndGlobal
diff --git a/src/Communication/Sms/SmsSendResult.cs b/src/Communication/Sms/SmsSendResult.cs
deleted file mode 100644
index 85fd33a6..00000000
--- a/src/Communication/Sms/SmsSendResult.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-namespace Dgmjr.AspNetCore.Communication.Sms;
-
-///
-/// Represents the result of sending an SMS message.
-///
-public readonly record struct SmsSendResult : ISmsSendResult
-{
- public SmsSendResult(Azure.Communication.Sms.SmsSendResult result)
- {
- StatusCode = result.HttpStatusCode;
- ErrorMessage = result.ErrorMessage;
- To = (PhoneNumber)result.To;
- }
-
- public string? ErrorMessage { get; init; }
- public PhoneNumber To { get; init; }
-
- ///
- /// Gets the status code of the message send result.
- ///
- public int StatusCode { get; init; }
-
- ///
- /// Gets a value indicating whether the SMS message was sent successfully.
- ///
- public bool IsSuccess =>
- StatusCode is SmsSendResponseCode.Success.Id or SmsSendResponseCode.Accepted.Id;
-
- ///
- /// Gets or sets the response code of the SMS send result.
- ///
- public Abstractions.ISmsSendResponseCode Status
- {
- get => SmsSendResponseCode.FromId(StatusCode);
- init => StatusCode = ((IIdentifiable)value).Id;
- }
-}
diff --git a/src/Configuration/Abstractions/IConfigureIHostApplicationBuilder.cs b/src/Configuration/Abstractions/IConfigureIHostApplicationBuilder.cs
index c1bbc85b..fcea03da 100644
--- a/src/Configuration/Abstractions/IConfigureIHostApplicationBuilder.cs
+++ b/src/Configuration/Abstractions/IConfigureIHostApplicationBuilder.cs
@@ -1,7 +1,9 @@
namespace Dgmjr.Configuration.Extensions;
+
+using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
public interface IConfigureIHostApplicationBuilder : IConfigureStuffInOrder
{
- void Configure(IHostApplicationBuilder builder);
+ void Configure(WebApplicationBuilder builder);
}
diff --git a/src/Configuration/Builder/WebApplicationBuilderFacade.cs b/src/Configuration/Builder/WebApplicationBuilderFacade.cs
new file mode 100644
index 00000000..280e0fdf
--- /dev/null
+++ b/src/Configuration/Builder/WebApplicationBuilderFacade.cs
@@ -0,0 +1,40 @@
+namespace Dgmjr.Configuration.Extensions.Builder;
+
+using System;
+using System.Collections.Generic;
+
+using Microsoft.AspNetCore.Builder;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Diagnostics.Metrics;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+internal class WebApplicationBuilderFacade(WebApplicationBuilder wrappedBuilder)
+ : IHostApplicationBuilder
+{
+ public IDictionary