Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 9526dbc

Browse files
committed
DocTypeGridEditorHelper - minor tidy-up
Removed the explicit references for `ApplicationContext.Current.Services`, as we already had a private static reference set on the class.
1 parent 22464db commit 9526dbc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private static IPublishedContent ConvertValue(string id, string contentTypeAlias
4848
contentTypeAlias = Services.ContentTypeService.GetAliasByGuid(contentTypeGuid);
4949

5050
var publishedContentType = PublishedContentType.Get(PublishedItemType.Content, contentTypeAlias);
51-
var contentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(contentTypeAlias);
51+
var contentType = Services.ContentTypeService.GetContentType(contentTypeAlias);
5252
var properties = new List<IPublishedProperty>();
5353

5454
// Convert all the properties
@@ -91,15 +91,14 @@ private static IPublishedContent ConvertValue(string id, string contentTypeAlias
9191
*/
9292
prop2 = new Property(propType2, newValue);
9393
}
94-
catch(Exception ex)
94+
catch (Exception ex)
9595
{
9696
LogHelper.Error<DocTypeGridEditorHelper>("[DocTypeGridEditor] Error creating Property object.", ex);
9797
}
9898

9999
if (prop2 != null)
100100
{
101-
var newValue2 = propEditor.ValueEditor.ConvertDbToString(prop2, propType2,
102-
ApplicationContext.Current.Services.DataTypeService);
101+
var newValue2 = propEditor.ValueEditor.ConvertDbToString(prop2, propType2, Services.DataTypeService);
103102

104103
properties.Add(new DetachedPublishedProperty(propType, newValue2));
105104
}

0 commit comments

Comments
 (0)