/// <summary> /// Adds all the exported (public) types in the given assembly to the scope of used types. /// </summary> public static void AddTypes(this IStringlyScope scope, Assembly assembly) { foreach (var type in assembly.GetExportedTypes()) { scope.AddType(type); } }
/// <summary> /// Adds the given types to the scope of used types. /// </summary> public static void AddTypes(this IStringlyScope scope, IEnumerable<Type> types) { foreach (var type in types) { scope.AddType(type); } }
public static void AddResttpControllers(this IoCContainerBuilder builder, Assembly assembly) { var controllerTypes = assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(RestController))); foreach (var controllerType in controllerTypes) { builder.AddType(controllerType).ForSelf().SetPerRequest(); } }
private static void AddTypes(this EdmModel model, Dictionary<Type, IEdmType> types) { Contract.Assert(model != null); Contract.Assert(types != null); foreach (IEdmType type in types.Values) { model.AddType(type); } }
private static void AddTypes(this EdmModel model, IEnumerable<IEdmStructuredType> structuredTypes) { Contract.Assert(model != null); Contract.Assert(structuredTypes != null); foreach (IEdmStructuredType type in structuredTypes) { model.AddType(type); } }
/// <summary> /// Adds the given type to the scope of used types. /// </summary> public static void AddType(this IStringlyScope scope, Type type) { scope.AddType(SafeGenericTypeName(type)); }