diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-25 18:46:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-25 18:46:01 +0800 |
commit | f08f53d6fcd9baf9dd3b95209f7c7448ae8168d4 (patch) | |
tree | c6ec0a916c78a02b36113fb62f0e919019df6cfc /Timeline/Services/DatabaseExtensions.cs | |
parent | 20089ee8a29f9c59a28779baadf5560bca9f7be1 (diff) | |
parent | 2528710897c6995eaa6b04a63c1daa8cdffbf29d (diff) | |
download | timeline-f08f53d6fcd9baf9dd3b95209f7c7448ae8168d4.tar.gz timeline-f08f53d6fcd9baf9dd3b95209f7c7448ae8168d4.tar.bz2 timeline-f08f53d6fcd9baf9dd3b95209f7c7448ae8168d4.zip |
Merge pull request #52 from crupest/i18n
Add NeutralResourcesLanguage. Conform to best practices.
Diffstat (limited to 'Timeline/Services/DatabaseExtensions.cs')
-rw-r--r-- | Timeline/Services/DatabaseExtensions.cs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Timeline/Services/DatabaseExtensions.cs b/Timeline/Services/DatabaseExtensions.cs index 62b22f00..8cbc8fef 100644 --- a/Timeline/Services/DatabaseExtensions.cs +++ b/Timeline/Services/DatabaseExtensions.cs @@ -1,6 +1,5 @@ using Microsoft.EntityFrameworkCore;
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Timeline.Entities;
@@ -22,9 +21,9 @@ namespace Timeline.Services {
if (username == null)
throw new ArgumentNullException(nameof(username));
- var (result, messageGenerator) = validator.Validate(username);
+ var (result, message) = validator.Validate(username);
if (!result)
- throw new UsernameBadFormatException(username, messageGenerator(null));
+ throw new UsernameBadFormatException(username, message);
var userId = await userDbSet.Where(u => u.Name == username).Select(u => u.Id).SingleOrDefaultAsync();
if (userId == 0)
|