public static IServiceCollection AddAssembly(this IServiceCollection collection, object context, bool compile = true) { if (context == null) { throw new ArgumentNullException("context"); } return collection.AddAssembly(context.GetType(), compile); }
public static IServiceCollection AddAssembly(this IServiceCollection collection, Type type, bool compile = true) { if (collection == null) { throw new ArgumentNullException("collection"); } var assembly = type.GetTypeInfo().Assembly; return collection.AddAssembly(assembly, compile); }