private void GenerateDependants(IEnumerable <IContentType> composedOfThis)
 {
     foreach (var umbracoCompositeType in composedOfThis)
     {
         var compositeType = ContentTypeMapping.Map(umbracoCompositeType);
         GenerateClass(compositeType);
     }
 }
        private void GenerateDependencies(IContentTypeComposition umbracoContentType, IEnumerable <IContentType> allContentTypes)
        {
            var compositionIds   = umbracoContentType.CompositionIds();
            var thisIsComposedOf = allContentTypes
                                   .Where(ct => compositionIds.Contains(ct.Id) && umbracoContentType.ParentId != ct.Id)
                                   .ToList();

            foreach (var composition in thisIsComposedOf)
            {
                var compositionType = ContentTypeMapping.Map(composition);
                compositionType.IsMixin = true;
                GenerateClass(compositionType);
                GenerateInterface(compositionType);
            }
        }
        public void GenerateModelAndDependants(IContentTypeService service, IContentTypeComposition umbracoContentType)
        {
            var contentType     = ContentTypeMapping.Map(umbracoContentType);
            var allContentTypes = service.GetAllContentTypes().ToList();

            GenerateDependencies(umbracoContentType, allContentTypes);

            var composedOfThis = GetDependants(umbracoContentType, allContentTypes);

            var isMixin = composedOfThis.Any();

            if (isMixin)
            {
                contentType.IsMixin = true;
            }

            GenerateClass(contentType);

            if (isMixin)
            {
                GenerateInterface(contentType);
                GenerateDependants(composedOfThis);
            }
        }