Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendy committed Dec 8, 2018
1 parent 72e92b8 commit ae1145d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Our.Umbraco.Look/Models/LookMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class LookMatch : SearchResult
/// <summary>
/// Lazy evaluation of Item for IPublishedContent
/// </summary>
public IPublishedContent Item => this._item.Value; // TODO: rename to Node
public IPublishedContent Item => this._item.Value;

/// <summary>
/// The custom name field
Expand Down
19 changes: 7 additions & 12 deletions src/Our.Umbraco.Look/Models/LookResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@
namespace Our.Umbraco.Look.Models
{
/// <summary>
/// Response model for a LookQuery (this can be cast into Examine.ISearchResults for compatability)
/// Response model for a LookQuery
/// </summary>
public class LookResult : ISearchResults
{
/// <summary>
/// The wrapped enumerable
/// </summary>
private readonly IEnumerable<LookMatch> _lookMatches;

/// <summary>
/// Expected total number of results in the enumerable
/// </summary>
Expand All @@ -24,7 +19,7 @@ public class LookResult : ISearchResults
/// <summary>
/// Get the results enumerable with the LookMatch objects
/// </summary>
public IEnumerable<LookMatch> Matches => this._lookMatches;
public IEnumerable<LookMatch> Matches { get; }

/// <summary>
/// Always returned as an array (which may be empty)
Expand All @@ -44,7 +39,7 @@ public class LookResult : ISearchResults
/// <param name="facets"></param>
internal LookResult(IEnumerable<LookMatch> lookMatches, int total, Facet[] facets)
{
this._lookMatches = lookMatches;
this.Matches = lookMatches;
this.TotalItemCount = total;
this.Facets = facets ?? new Facet[] { };
this.Success = true;
Expand All @@ -55,7 +50,7 @@ internal LookResult(IEnumerable<LookMatch> lookMatches, int total, Facet[] facet
/// </summary>
internal LookResult()
{
this._lookMatches = Enumerable.Empty<LookMatch>();
this.Matches = Enumerable.Empty<LookMatch>();
this.TotalItemCount = 0;
this.Facets = new Facet[] { };
this.Success = true;
Expand All @@ -67,7 +62,7 @@ internal LookResult()
/// <param name="loggingMessage">Message to debug log</param>
internal LookResult(string loggingMessage)
{
this._lookMatches = Enumerable.Empty<LookMatch>();
this.Matches = Enumerable.Empty<LookMatch>();
this.TotalItemCount = 0;
this.Facets = new Facet[] { };
this.Success = false;
Expand All @@ -82,7 +77,7 @@ internal LookResult(string loggingMessage)
/// <returns></returns>
public IEnumerable<SearchResult> Skip(int skip)
{
return this._lookMatches.Skip(skip);
return this.Matches.Skip(skip);
}

/// <summary>
Expand All @@ -91,7 +86,7 @@ public IEnumerable<SearchResult> Skip(int skip)
/// <returns></returns>
public IEnumerator<SearchResult> GetEnumerator()
{
return this._lookMatches.GetEnumerator();
return this.Matches.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator()
Expand Down

0 comments on commit ae1145d

Please sign in to comment.