Skip to content

Commit 81b49e9

Browse files
committed
Add Summary to TryParse of DmarcRecordParser
1 parent c606d6b commit 81b49e9

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/Nager.EmailAuthentication/DmarcRecordParser.cs

+43
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ namespace Nager.EmailAuthentication
88
/// </summary>
99
public static class DmarcRecordParser
1010
{
11+
/// <summary>
12+
/// Attempts to parse a raw DMARC record string into a <see cref="DmarcRecord"/> object.
13+
/// </summary>
14+
/// <param name="dmarcRaw">The raw DMARC record string to be parsed.</param>
15+
/// <param name="dmarcRecord">
16+
/// When this method returns, contains the parsed <see cref="DmarcRecord"/> if the parsing succeeded;
17+
/// otherwise, <c>null</c>.
18+
/// </param>
19+
/// <returns>
20+
/// <c>true</c> if the parsing was successful (i.e., all required fields are present and valid);
21+
/// otherwise, <c>false</c>.
22+
/// </returns>
1123
public static bool TryParse(
1224
string? dmarcRaw,
1325
[NotNullWhen(true)] out DmarcRecord? dmarcRecord)
@@ -21,6 +33,23 @@ public static bool TryParse(
2133
return TryParse(dataFragment, out dmarcRecord);
2234
}
2335

36+
/// <summary>
37+
/// Attempts to parse a raw DMARC record string into a <see cref="DmarcRecord"/> object while also
38+
/// returning additional parsing details.
39+
/// </summary>
40+
/// <param name="dmarcRaw">The raw DMARC record string to be parsed.</param>
41+
/// <param name="dmarcRecord">
42+
/// When this method returns, contains the parsed <see cref="DmarcRecord"/> if the parsing succeeded;
43+
/// otherwise, <c>null</c>.
44+
/// </param>
45+
/// <param name="parsingResults">
46+
/// When this method returns, contains an array of <see cref="ParsingResult"/> objects with additional details
47+
/// (such as warnings or informational messages) regarding the parsing process. This value may be <c>null</c>
48+
/// if the parsing did not occur.
49+
/// </param>
50+
/// <returns>
51+
/// <c>true</c> if the parsing was successful; otherwise, <c>false</c>.
52+
/// </returns>
2453
public static bool TryParse(
2554
string? dmarcRaw,
2655
[NotNullWhen(true)] out DmarcRecord? dmarcRecord,
@@ -35,6 +64,20 @@ public static bool TryParse(
3564
return TryParse(dataFragment, out dmarcRecord);
3665
}
3766

67+
/// <summary>
68+
/// Attempts to convert a <see cref="DmarcRecordDataFragment"/> into a fully validated
69+
/// <see cref="DmarcRecord"/> by parsing and validating all required DMARC fields.
70+
/// </summary>
71+
/// <param name="dmarcDataFragment">
72+
/// The <see cref="DmarcRecordDataFragment"/> containing individual DMARC parameter strings to be parsed.
73+
/// </param>
74+
/// <param name="dmarcRecord">
75+
/// When this method returns, contains the parsed and validated <see cref="DmarcRecord"/> if successful;
76+
/// otherwise, <c>null</c>.
77+
/// </param>
78+
/// <returns>
79+
/// <c>true</c> if the conversion and validation were successful; otherwise, <c>false</c>.
80+
/// </returns>
3881
public static bool TryParse(
3982
DmarcRecordDataFragment dmarcDataFragment,
4083
[NotNullWhen(true)] out DmarcRecord? dmarcRecord)

0 commit comments

Comments
 (0)