Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RsapiDao GetResultData method #150

Open
Arithmomaniac opened this issue Sep 26, 2018 · 1 comment
Open

Improve RsapiDao GetResultData method #150

Arithmomaniac opened this issue Sep 26, 2018 · 1 comment

Comments

@Arithmomaniac
Copy link
Collaborator

Currently, method give little detail on error.

A more robust solution would do something like this:

private static string GenerateMessage(string globalErrorMessage, List<Result<T>> failureItems)
{
	var sb = new StringBuilder(globalErrorMessage ?? "One or more results failed.");
	foreach (var message in failureItems.Select(x => $"- {x.Message}"))
		sb.AppendLine().Append(message);
	return sb.ToString();
}
@KalinaTSD
Copy link
Collaborator

Sounds valuable for the whole ORM error handling, It will be applied by me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants