Bug Fixes: enrolment, assignment and search order
This commit is contained in:
@@ -9,16 +9,31 @@ namespace Disco.Models.Services.Searching
|
||||
public class UserSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "User";
|
||||
private Lazy<string[]> LazyScoreValue;
|
||||
|
||||
public UserSearchResultItem()
|
||||
{
|
||||
this.LazyScoreValue = new Lazy<string[]>(BuildScoreValues, false);
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.DisplayName, this.Id); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1} {2}", this.Id.Substring(0, this.Id.IndexOf('\\')), this.Id, this.DisplayName); } }
|
||||
public string[] ScoreValues { get { return LazyScoreValue.Value; } }
|
||||
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
|
||||
private string[] BuildScoreValues()
|
||||
{
|
||||
return new string[] {
|
||||
this.Id.Substring(this.Id.IndexOf('\\') + 1),
|
||||
this.Id,
|
||||
this.DisplayName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user