@@ -17,16 +17,16 @@ namespace Our.Umbraco.DocTypeGridEditor.ValueProcessing
17
17
public class DocTypeGridEditorDataValueReference : IDataValueReferenceFactory , IDataValueReference
18
18
{
19
19
private readonly Lazy < Dictionary < string , IContentType > > _contentTypes ;
20
- private readonly PropertyEditorCollection _dataEditors ;
20
+ private readonly Lazy < PropertyEditorCollection > _dataEditors ;
21
21
22
22
public IDataValueReference GetDataValueReference ( ) => this ;
23
23
24
24
public bool IsForEditor ( IDataEditor dataEditor ) => dataEditor . Alias . InvariantEquals ( Constants . PropertyEditors . Aliases . Grid ) ;
25
25
26
26
27
- public DocTypeGridEditorDataValueReference ( IContentTypeService contentTypeService , PropertyEditorCollection dataEditors )
27
+ public DocTypeGridEditorDataValueReference ( Lazy < IContentTypeService > contentTypeService , Lazy < PropertyEditorCollection > dataEditors )
28
28
{
29
- _contentTypes = new Lazy < Dictionary < string , IContentType > > ( ( ) => contentTypeService . GetAll ( ) . ToDictionary ( c => c . Alias ) ) ;
29
+ _contentTypes = new Lazy < Dictionary < string , IContentType > > ( ( ) => contentTypeService . Value . GetAll ( ) . ToDictionary ( c => c . Alias ) ) ;
30
30
_dataEditors = dataEditors ;
31
31
}
32
32
@@ -50,7 +50,7 @@ public IEnumerable<UmbracoEntityReference> GetReferences(object value)
50
50
{
51
51
if ( propertyTypes . TryGetValue ( property . Name , out var propertyType ) )
52
52
{
53
- if ( _dataEditors . TryGet ( propertyType . PropertyEditorAlias , out var propertyEditor ) )
53
+ if ( _dataEditors . Value . TryGet ( propertyType . PropertyEditorAlias , out var propertyEditor ) )
54
54
{
55
55
if ( propertyEditor . GetValueEditor ( ) is IDataValueReference reference )
56
56
{
0 commit comments