Moved implementation of check for existance of username on creating user from user service to repository.
This commit is contained in:
@@ -626,6 +626,11 @@ ORDER BY colName";
|
||||
}
|
||||
|
||||
public bool Exists(string username)
|
||||
{
|
||||
return ExistsByUserName(username);
|
||||
}
|
||||
|
||||
public bool ExistsByUserName(string username)
|
||||
{
|
||||
var sql = SqlContext.Sql()
|
||||
.SelectCount()
|
||||
@@ -635,6 +640,16 @@ ORDER BY colName";
|
||||
return Database.ExecuteScalar<int>(sql) > 0;
|
||||
}
|
||||
|
||||
public bool ExistsByLogin(string login)
|
||||
{
|
||||
var sql = SqlContext.Sql()
|
||||
.SelectCount()
|
||||
.From<UserDto>()
|
||||
.Where<UserDto>(x => x.Login == login);
|
||||
|
||||
return Database.ExecuteScalar<int>(sql) > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="IUser"/> objects associated with a given group
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user