Cleanup PR, document and rename things

This commit is contained in:
Stephan
2019-02-01 17:16:50 +01:00
parent e88443e549
commit 132c3c0c8e
29 changed files with 237 additions and 140 deletions

View File

@@ -6,15 +6,15 @@ namespace Umbraco.Core
{
public static class ServiceContextExtensions
{
public static IContentTypeServiceBase<T> GetContentTypeService<T>(this ServiceContext services)
public static IContentTypeBaseService<T> GetContentTypeService<T>(this ServiceContext services)
where T : IContentTypeComposition
{
if (typeof(T).Implements<IContentType>())
return services.ContentTypeService as IContentTypeServiceBase<T>;
return services.ContentTypeService as IContentTypeBaseService<T>;
if (typeof(T).Implements<IMediaType>())
return services.MediaTypeService as IContentTypeServiceBase<T>;
return services.MediaTypeService as IContentTypeBaseService<T>;
if (typeof(T).Implements<IMemberType>())
return services.MemberTypeService as IContentTypeServiceBase<T>;
return services.MemberTypeService as IContentTypeBaseService<T>;
throw new ArgumentException("Type " + typeof(T).FullName + " does not have a service.");
}
}