Cleanup PR, document and rename things
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user