示例#1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddSingleton(Configuration);
     AutoMapperSetup.AddAutoMapperSetup(services);
     SwaggerSetup.AddSwaggerSetup(services);
     DependencyInjectionSetup.AddDependencyInjectionSetup(services, Configuration);
     ApiSetup.AddApiSetup(services, Configuration);
 }
        public static List <MsDocEntryPoint> GenerateDocs(string msDocFolder)
        {
            //Generate the docs first
            var container = ApiSetup.ConfigureEntryPoints();
            var entries   = container.Resolve <IEnumerable <IApiMethodCall> >();

            var apiEntryPoints = container.Registrations.Where(x => x.RegisteredType == typeof(IApiEntryPoint)).ToList();

            var generator = new MsDocDocumentGenerator(Path.Combine(msDocFolder, "help.xml"), msDocFolder, container);

            foreach (var apiEntryPoint in entries.GroupBy(x => x.ApiClassType))
            {
                var point = apiEntryPoint;
                generator.GenerateDocForEntryPoint(
                    apiEntryPoints.SingleOrDefault(x => x.MappedToType == point.Key),
                    apiEntryPoint.AsEnumerable());
            }

            return(generator.Points);
        }
示例#3
0
文件: Task4.cs 项目: EskerGar/Test
 public static void SetupObjectB(this ApiSetup <ObjectB> b)
 {
 }
示例#4
0
文件: Task4.cs 项目: EskerGar/Test
 public static void SetupObjectA(this ApiSetup <ObjectA> a)
 {
 }
示例#5
0
 internal static void SetupObjectA <T>(this ApiSetup <T> obj) where T : ISomeInterfaceA
 {
     Console.WriteLine("A object setup");
 }
示例#6
0
 public static void SetupObjectB <B>(this ApiSetup <B> apiSetup) where B : ObjectB
 {
 }
示例#7
0
 public static void SetupObjectA <A>(this ApiSetup <A> apiSetup) where A : ObjectA
 {
 }