protected override IServiceCollection ConfigureApi(IServiceCollection services) { Type apiType = this.GetType(); // Add core and convention's services services = services.AddCoreServices(apiType) .AddAttributeServices(apiType) .AddConventionBasedServices(apiType); // Add EF related services services.AddEfProviderServices <T>(); // This is used to add the publisher's services ApiConfiguration.GetPublisherServiceCallback(apiType)(services); return(services); }
protected override IServiceCollection ConfigureApi(IServiceCollection services) { Type apiType = this.GetType(); // Add core and conversion's services services = services.AddCoreServices(apiType) .AddAttributeServices(apiType) .AddConventionBasedServices(apiType); // Add EF related services services.AddEfProviderServices <NorthwindContext>(); // Add customized services, after EF model builder and before WebApi operation model builder services.ChainPrevious <IModelBuilder, NorthwindModelExtender>(); // This is used to add the publisher's services ApiConfiguration.GetPublisherServiceCallback(apiType)(services); return(services); }