Use immutable types

This commit is contained in:
abi
2020-01-02 23:00:53 +00:00
parent 575ec6fec4
commit 12f51dec4e
2 changed files with 13 additions and 13 deletions

View File

@@ -4,10 +4,10 @@ namespace Umbraco.Web.Search
{
public interface IInternalSearchConstants
{
List<string> GetBackOfficeFields();
List<string> GetBackOfficeMembersFields();
List<string> GetBackOfficeMediaFields();
List<string> GetBackOfficeDocumentFields();
IEnumerable<string> GetBackOfficeFields();
IEnumerable<string> GetBackOfficeMembersFields();
IEnumerable<string> GetBackOfficeMediaFields();
IEnumerable<string> GetBackOfficeDocumentFields();
}
}

View File

@@ -6,25 +6,25 @@ namespace Umbraco.Web
{
public class InternalSearchConstants : IInternalSearchConstants
{
private List<string> _backOfficeFields = new List<string> {"id", "__NodeId", "__Key"};
public List<string> GetBackOfficeFields()
private IReadOnlyList<string> _backOfficeFields = new List<string> {"id", "__NodeId", "__Key"};
public IEnumerable<string> GetBackOfficeFields()
{
return _backOfficeFields;
}
private List<string> _backOfficeMembersFields = new List<string> {"email", "loginName"};
public List<string> GetBackOfficeMembersFields()
private IReadOnlyList<string> _backOfficeMembersFields = new List<string> {"email", "loginName"};
public IEnumerable<string> GetBackOfficeMembersFields()
{
return _backOfficeMembersFields;
}
private List<string> _backOfficeMediaFields = new List<string> {UmbracoExamineIndex.UmbracoFileFieldName };
public List<string> GetBackOfficeMediaFields()
private IReadOnlyList<string> _backOfficeMediaFields = new List<string> {UmbracoExamineIndex.UmbracoFileFieldName };
public IEnumerable<string> GetBackOfficeMediaFields()
{
return _backOfficeMediaFields;
}
private List<string> _backOfficeDocumentFields = new List<string> ();
public List<string> GetBackOfficeDocumentFields()
private IReadOnlyList<string> _backOfficeDocumentFields = new List<string> ();
public IEnumerable<string> GetBackOfficeDocumentFields()
{
return _backOfficeDocumentFields;
}