Skip to content

Commit 4872bc3

Browse files
authored
Merge pull request #10 from PandaTechAM/development
.net 9 upgrade
2 parents 65c14e6 + 8f750cd commit 4872bc3

Some content is hidden

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

43 files changed

+1177
-918
lines changed

.editorconfig

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
###############################
2+
# PandaTech Editor Config #
3+
###############################
4+
5+
6+
################################
7+
# ReSharper Generated Settings #
8+
################################
9+
10+
[*]
11+
charset = utf-8-bom
12+
end_of_line = crlf
13+
trim_trailing_whitespace = false
14+
insert_final_newline = false
15+
indent_style = space
16+
indent_size = 4
17+
18+
# Microsoft .NET properties
19+
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
20+
csharp_style_prefer_utf8_string_literals = true:suggestion
21+
csharp_style_var_elsewhere = true:suggestion
22+
csharp_style_var_for_built_in_types = true:suggestion
23+
csharp_style_var_when_type_is_apparent = true:suggestion
24+
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
25+
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
26+
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
27+
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
28+
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
29+
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
30+
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
31+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
32+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
33+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
34+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
35+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
36+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
37+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
38+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
39+
dotnet_style_predefined_type_for_member_access = true:suggestion
40+
dotnet_style_qualification_for_event = false:suggestion
41+
dotnet_style_qualification_for_field = false:suggestion
42+
dotnet_style_qualification_for_method = false:suggestion
43+
dotnet_style_qualification_for_property = false:suggestion
44+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
45+
46+
# ReSharper properties
47+
resharper_align_linq_query = true
48+
resharper_align_multiline_calls_chain = true
49+
resharper_apply_auto_detected_rules = false
50+
resharper_braces_for_for = required
51+
resharper_braces_for_foreach = required
52+
resharper_braces_for_ifelse = required
53+
resharper_braces_for_while = required
54+
resharper_cpp_insert_final_newline = true
55+
resharper_csharp_indent_size = 3
56+
resharper_csharp_max_enum_members_on_line = 0
57+
resharper_csharp_tab_width = 3
58+
resharper_csharp_wrap_arguments_style = chop_if_long
59+
resharper_csharp_wrap_parameters_style = chop_if_long
60+
resharper_formatter_off_tag = @formatter:off
61+
resharper_formatter_on_tag = @formatter:on
62+
resharper_formatter_tags_enabled = true
63+
resharper_keep_existing_declaration_parens_arrangement = false
64+
resharper_keep_existing_expr_member_arrangement = false
65+
resharper_keep_existing_initializer_arrangement = false
66+
resharper_keep_existing_switch_expression_arrangement = false
67+
resharper_max_array_initializer_elements_on_line = 0
68+
resharper_max_initializer_elements_on_line = 0
69+
resharper_place_accessorholder_attribute_on_same_line = false
70+
resharper_place_accessor_attribute_on_same_line = false
71+
resharper_place_field_attribute_on_same_line = false
72+
resharper_place_simple_anonymousmethod_on_single_line = false
73+
resharper_place_simple_embedded_statement_on_same_line = false
74+
resharper_place_simple_initializer_on_single_line = false
75+
resharper_place_simple_property_pattern_on_single_line = false
76+
resharper_use_indent_from_vs = false
77+
resharper_wrap_after_property_in_chained_method_calls = true
78+
resharper_wrap_array_initializer_style = chop_if_long
79+
resharper_wrap_chained_method_calls = chop_always
80+
resharper_wrap_linq_expressions = chop_always
81+
resharper_wrap_list_pattern = chop_if_long
82+
resharper_wrap_object_and_collection_initializer_style = chop_always
83+
resharper_wrap_property_pattern = chop_always
84+
85+
# ReSharper inspection severities
86+
resharper_arrange_redundant_parentheses_highlighting = hint
87+
resharper_arrange_this_qualifier_highlighting = hint
88+
resharper_arrange_type_member_modifiers_highlighting = hint
89+
resharper_arrange_type_modifiers_highlighting = hint
90+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
91+
resharper_built_in_type_reference_style_highlighting = hint
92+
resharper_enforce_foreach_statement_braces_highlighting = warning
93+
resharper_enforce_for_statement_braces_highlighting = warning
94+
resharper_enforce_if_statement_braces_highlighting = warning
95+
resharper_enforce_lock_statement_braces_highlighting = warning
96+
resharper_enforce_using_statement_braces_highlighting = warning
97+
resharper_enforce_while_statement_braces_highlighting = warning
98+
resharper_mvc_action_not_resolved_highlighting = warning
99+
resharper_mvc_area_not_resolved_highlighting = warning
100+
resharper_mvc_controller_not_resolved_highlighting = warning
101+
resharper_mvc_masterpage_not_resolved_highlighting = warning
102+
resharper_mvc_partial_view_not_resolved_highlighting = warning
103+
resharper_mvc_template_not_resolved_highlighting = warning
104+
resharper_mvc_view_component_not_resolved_highlighting = warning
105+
resharper_mvc_view_component_view_not_resolved_highlighting = warning
106+
resharper_mvc_view_not_resolved_highlighting = warning
107+
resharper_razor_assembly_not_resolved_highlighting = warning
108+
resharper_redundant_base_qualifier_highlighting = warning
109+
resharper_web_config_module_not_resolved_highlighting = warning
110+
resharper_web_config_type_not_resolved_highlighting = warning
111+
resharper_web_config_wrong_module_highlighting = warning
112+
113+
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,bowerrc,jest.config}]
114+
indent_style = space
115+
indent_size = 2
116+
117+
[{*.yaml,*.yml}]
118+
indent_style = space
119+
indent_size = 2
120+
121+
[*.cs]
122+
indent_style = space
123+
indent_size = 3
124+
tab_width = 3
125+
126+
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
127+
indent_style = space
128+
indent_size = 4
129+
tab_width = 4
130+
131+
#########################
132+
# Custom added settings #
133+
#########################
134+
[*.cs]
135+
dotnet_diagnostic.cs8600.severity = error #Converting null literal or possible null value to non-nullable type.
136+
dotnet_diagnostic.cs8601.severity = error #Possible null reference assignment.
137+
dotnet_diagnostic.cs8602.severity = error #possible dereference of a null reference
138+
dotnet_diagnostic.cs8603.severity = error #possible null reference return
139+
dotnet_diagnostic.cs8604.severity = error #possible null reference argument for parameter
140+
dotnet_diagnostic.cs8605.severity = error #Unboxing a possibly null value
141+
dotnet_diagnostic.cs8618.severity = error # Non-nullable field is uninitialized. Consider declaring as nullable.
142+
dotnet_diagnostic.cs8625.severity = error # Cannot convert null literal to non-nullable reference type.
143+
dotnet_diagnostic.cs8762.severity = error # Nullability of reference types in type doesn't match overridden member.
144+
dotnet_diagnostic.cs1717.severity = error #variable is assigned to itself
145+
dotnet_diagnostic.cs1718.severity = error #comparison made to same variable
146+
dotnet_diagnostic.cs0659.severity = error #overriding object.Equals but not overriding object.GetHashCode
147+
dotnet_diagnostic.cs0251.severity = error #Indexing an array with a negative index (array indices always start at zero)
148+
dotnet_diagnostic.s3363.severity = none #Never set DateTime as PrimaryKey. Ignored as we never do it but have warnings for cache entities.
149+
dotnet_diagnostic.ca2016.severity = error #Forwarding cancellation tokens
150+
csharp_style_namespace_declarations = file_scoped:error
151+
resharper_entity_framework_model_validation_unlimited_string_length_highlighting = none
152+
153+
154+
#########################
155+
# VS added settings #
156+
#########################
157+
158+
[*.cs]
159+
csharp_style_namespace_declarations = file_scoped:error
160+
csharp_indent_labels = one_less_than_current
161+
csharp_using_directive_placement = outside_namespace:silent
162+
csharp_prefer_simple_using_statement = true:suggestion
163+
csharp_prefer_braces = true:silent
164+
csharp_style_prefer_method_group_conversion = true:silent
165+
csharp_style_prefer_top_level_statements = true:silent
166+
csharp_style_prefer_primary_constructors = true:suggestion
167+
csharp_style_expression_bodied_methods = false:silent
168+
csharp_style_expression_bodied_constructors = false:silent
169+
csharp_style_expression_bodied_operators = false:silent
170+
csharp_style_expression_bodied_properties = true:silent
171+
csharp_style_expression_bodied_indexers = true:silent
172+
csharp_style_expression_bodied_accessors = true:silent
173+
csharp_style_expression_bodied_lambdas = true:silent
174+
csharp_style_expression_bodied_local_functions = false:silent
175+
176+
[{*.yaml,*.yml}]
177+
dotnet_style_namespace_match_folder = true:suggestion
178+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
179+
tab_width = 3
180+
dotnet_style_coalesce_expression = true:suggestion
181+
dotnet_style_null_propagation = true:suggestion
182+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
183+
dotnet_style_prefer_auto_properties = true:silent
184+
dotnet_style_object_initializer = true:suggestion
185+
dotnet_style_collection_initializer = true:suggestion
186+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
187+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
188+
189+
[*.csv]
190+
indent_style = tab
191+
tab_width = 4

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Setup .NET Core
22-
uses: actions/setup-dotnet@v3
22+
uses: actions/setup-dotnet@v4
2323
with:
2424
global-json-file: global.json
2525

Communicator.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
.gitignore = .gitignore
1717
global.json = global.json
1818
Readme.md = Readme.md
19+
.editorconfig = .editorconfig
1920
EndProjectSection
2021
EndProject
2122
Global

Readme.md

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,52 @@
11
# 1. PandaTech.Communicator
22

33
- [1. EasyRateLimiter](#1-easyratelimiter)
4-
- [1.1. Introduction](#11-introduction)
5-
- [1.2. Installation](#12-installation)
6-
- [1.3. Setup](#13-setup)
7-
- [1.3.1. Program.cs Example](#131-programcs-example)
8-
- [1.3.1.1. Using WebApplicationBuilder](#1311-using-webapplicationbuilder)
9-
- [1.3.1.2. Using IServiceCollection](#1312-using-iservicecollection)
10-
- [1.3.2. Appsettings.json Example](#132-appsettingsjson-example)
11-
- [1.4. Configuration Options Explained](#14-configuration-options-explained)
12-
- [1.5. Usage](#15-usage)
13-
- [1.5.1. Send SMS message](#151-send-sms-message)
14-
- [1.5.2. Send Email message](#152-send-email-message)
15-
- [1.6. Limitations](#16-limitations)
16-
- [1.7. License](#17-license)
4+
- [1.1. Introduction](#11-introduction)
5+
- [1.2. Installation](#12-installation)
6+
- [1.3. Setup](#13-setup)
7+
- [1.3.1. Program.cs Example](#131-programcs-example)
8+
- [1.3.1.1. Using WebApplicationBuilder](#1311-using-webapplicationbuilder)
9+
- [1.3.1.2. Using IServiceCollection](#1312-using-iservicecollection)
10+
- [1.3.2. Appsettings.json Example](#132-appsettingsjson-example)
11+
- [1.4. Configuration Options Explained](#14-configuration-options-explained)
12+
- [1.5. Usage](#15-usage)
13+
- [1.5.1. Send SMS message](#151-send-sms-message)
14+
- [1.5.2. Send Email message](#152-send-email-message)
15+
- [1.6. Limitations](#16-limitations)
16+
- [1.7. License](#17-license)
1717

1818
## 1.1. Introduction
19-
**PandaTech.Communicator** is aimed to send Email and SMS messages to the clients of your service where you use this library.
2019

21-
- **Email:** By given setup it's easy and fast to configure and setup Email providers for later use by different channels.
22-
- **SMS:** By given setup it's easy and fast to configure and setup already integrated SMS providers for later use by different channels.
23-
- **Dexatel**
24-
- **Twilio**
20+
**PandaTech.Communicator** is aimed to send Email and SMS messages to the clients of your service where you use this
21+
library.
22+
23+
- **Email:** By given setup it's easy and fast to configure and setup Email providers for later use by different
24+
channels.
25+
- **SMS:** By given setup it's easy and fast to configure and setup already integrated SMS providers for later use by
26+
different channels.
27+
- **Dexatel**
28+
- **Twilio**
2529

2630
This package is ideal for efficient and reliable messaging in any application.
2731

2832
## 1.2. Installation
2933

30-
Install this NuGet library directly from the IDE package installer or by following command:
34+
Install this NuGet library directly from the IDE package installer or by following command:
3135

3236
`dotnet add package PandaTech.Communicator`
3337

3438
## 1.3. Setup
3539

3640
To incorporate PandaTech.Communicator into your project, you have 2 primary methods to setup in your `Program.cs`:
3741

38-
The first method directly using `WebApplicationBuilder` from which `IConfiguration` is directly used. But for the second method builder is not accessible, so we pass `IConfiguration` into it as parameter.
42+
The first method directly using `WebApplicationBuilder` from which `IConfiguration` is directly used. But for the second
43+
method builder is not accessible, so we pass `IConfiguration` into it as parameter.
44+
3945
- `builder.AddCommunicator();`
4046
- `services.AddCommunicator(configuration);`
4147

42-
Configuration options can be specified either in `appsettings.json` or directly in `Program.cs`, with the latter taking precedence.
48+
Configuration options can be specified either in `appsettings.json` or directly in `Program.cs`, with the latter taking
49+
precedence.
4350

4451
There are several supported channels which must be kept during setup:
4552

@@ -63,13 +70,15 @@ SmsChannels
6370
};
6471
```
6572

66-
For each channel can be setup same provider, but it's recommended to have different sender, as they are dedicated for different purposes.
73+
For each channel can be setup same provider, but it's recommended to have different sender, as they are dedicated for
74+
different purposes.
6775

6876
### 1.3.1. Program.cs Example
6977

70-
In case of using SSL by setting UseSsl = true use port number 456, otherwise use 587 for non SSL connection.
78+
In case of using SSL by setting UseSsl = true use port number 456, otherwise use 587 for non SSL connection.
7179

7280
#### 1.3.1.1. Using `WebApplicationBuilder`
81+
7382
```csharp
7483
builder.AddCommunicator(options =>
7584
{
@@ -255,19 +264,25 @@ services.AddCommunicator(configuration, options =>
255264
}
256265
}
257266
```
267+
258268
The configuration options in `appsettings.json` and `program.cs` (priority) are identical.
259269

260270
## 1.4. Configuration Options Explained
261271

262272
- **Communicator:** Global settings for PandaTech.Communicator
263-
- **SmsFake:** This setup is for fake SMS service to be used which doesn't send real SMS messages and just return `TTask.CompletedTask`.
264-
- **SmsConfigurations:** SMS configurations given by `appsettings.json` or via `builder.AddCommunicator()` options for SMS.
265-
- **EmailFake:** This setup is for fake Email service to be used which doesn't send real SMS messages and just return `TTask.CompletedTask`.
266-
- **EmailConfigurations:** Email configurations given by `appsettings.json` or via `builder.AddCommunicator()` options for Email.
273+
- **SmsFake:** This setup is for fake SMS service to be used which doesn't send real SMS messages and just return
274+
`TTask.CompletedTask`.
275+
- **SmsConfigurations:** SMS configurations given by `appsettings.json` or via `builder.AddCommunicator()` options for
276+
SMS.
277+
- **EmailFake:** This setup is for fake Email service to be used which doesn't send real SMS messages and just return
278+
`TTask.CompletedTask`.
279+
- **EmailConfigurations:** Email configurations given by `appsettings.json` or via `builder.AddCommunicator()` options
280+
for Email.
267281

268282
## 1.5. Usage
269283

270-
In order to use the library, you need to generate `SmsMessage` or `EmailMessage` and use one of the interfaces mentioned above for the service you need to use.
284+
In order to use the library, you need to generate `SmsMessage` or `EmailMessage` and use one of the interfaces mentioned
285+
above for the service you need to use.
271286

272287
Both of them support multiple recipients.
273288

@@ -298,8 +313,9 @@ Channel is set by `EmailChannels` or by `SmsChannels` classes with constant valu
298313

299314
There are 2 interfaces `ISmsService` and `IEmailService` responsible for individual cases SMS or Email.
300315
Methods for sending SMS/Email messages are:
301-
- **SendAsync:**
302-
- **SendBulkAsync:**
316+
317+
- **SendAsync:**
318+
- **SendBulkAsync:**
303319

304320
The structure of the service interfaces are shown below.
305321

@@ -329,9 +345,9 @@ var sms = new SmsMessage
329345
await smsService.SendAsync(sms);
330346
```
331347

332-
Sms service returns general response which includes general properties in already integrated services.
348+
Sms service returns general response which includes general properties in already integrated services.
333349

334-
Both methods return `List<GeneralSmsResponse>` when you use them while sending sms.
350+
Both methods return `List<GeneralSmsResponse>` when you use them while sending sms.
335351
If you set a variable to the call, you will be able to use returned response.
336352

337353
```csharp
@@ -360,8 +376,11 @@ var email = new EmailMessage
360376
};
361377
await emailService.SendAsync(email);
362378
```
363-
Both methods return response (SendAsync - `string`; SendBulkAsync - `List<string>`) when you use them while sending email.
364-
If you set a variable to the call, you will be able to use returned response. Response structure varies on different email providers, so you can create your ouw return type and map returned string into it.
379+
380+
Both methods return response (SendAsync - `string`; SendBulkAsync - `List<string>`) when you use them while sending
381+
email.
382+
If you set a variable to the call, you will be able to use returned response. Response structure varies on different
383+
email providers, so you can create your ouw return type and map returned string into it.
365384

366385
```text
367386
2.0.0 OK 8ONXSST18NU4.DSCFVS8PQ0Q13@test AM0PR08MB5346.eurprd08.prod.outlook.com

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.200",
4-
"rollForward": "latestMajor"
3+
"version": "9.0.100",
4+
"rollForward": "latestMinor"
55
}
66
}

0 commit comments

Comments
 (0)