public override string[] GetUsersInRole(string roleName)
{
if (string.IsNullOrEmpty(roleName))
{
throw CreateArgumentNullOrEmptyException("roleName");
}
using (BlogUnitOfWork context = new BlogUnitOfWork(new ModelContextInit()))
{
var role = context.Roles.FirstOrDefault(Rl => Rl.RoleName == roleName);
if (role == null)
{
throw new InvalidOperationException("Role not found");
}
return role.Users.Select(Usr => Usr.Username).ToArray();
}
}