Skip to content

Commit

Permalink
Collect messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Nov 14, 2024
1 parent 76e0cd8 commit f0c4235
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/EasyFrameWork/RepositoryPattern/ServiceResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,9 @@ public string ErrorMessage
{
var msg = new StringBuilder();

foreach (Violation item in Errors)
foreach (var item in Errors)
{
if (item is Error)
{
msg.AppendLine(item.Message);
}
msg.AppendLine(item.Message);
}
return msg.ToString();
}
Expand All @@ -108,12 +105,9 @@ public string WarningMessage
get
{
var msg = new StringBuilder();
foreach (Violation item in _ruleViolations)
foreach (var item in Warnings)
{
if (item is Warning)
{
msg.AppendLine(item.Message);
}
msg.AppendLine(item.Message);
}
return msg.ToString();
}
Expand All @@ -136,12 +130,9 @@ public string InfoMessage
get
{
var msg = new StringBuilder();
foreach (Violation item in _ruleViolations)
foreach (var item in Infos)
{
if (item is Info)
{
msg.AppendLine(item.Message);
}
msg.AppendLine(item.Message);
}
return msg.ToString();
}
Expand Down

0 comments on commit f0c4235

Please sign in to comment.