/// <summary> /// Maps the given <paramref name="type"/> in <paramref name="typeMapping"/>. /// </summary> /// <param name="context">The <see cref="IMansionContext"/>.</param> /// <param name="definition">The <see cref="IndexDefinition"/>.</param> /// <param name="type">The <see cref="ITypeDefinition"/>.</param> /// <param name="typeMapping">The <see cref="TypeMapping"/>.</param> private static void MapType(IMansionContext context, IndexDefinition definition, ITypeDefinition type, TypeMapping typeMapping) { // map the type descriptor, if any TypeMapping.TypeMappingDescriptor descriptor; if (type.TryGetDescriptor(out descriptor)) descriptor.UpdateMapping(context, typeMapping); // map all the properties of this type MapProperties(context, type, typeMapping); // map all the analysis components defined on this type MapAnalysisComponents(context, type, definition); // loop over all the children of this type foreach (var childType in type.GetChildTypes(context)) { // clone the parent mapping, children should include the properties of the parent var childMapping = typeMapping.Clone(childType); // map the the child MapType(context, definition, childType, childMapping); } // append the mapping to the index definition definition.Add(typeMapping); }