MvcServiceCollectionExtensions.AddRazorPages Yöntem

Tanım

Aşırı Yüklemeler

AddRazorPages(IServiceCollection)

Belirtilen IServiceCollectionöğesine sayfalar için hizmetler ekler.

AddRazorPages(IServiceCollection, Action<RazorPagesOptions>)

Belirtilen IServiceCollectionöğesine sayfalar için hizmetler ekler.

AddRazorPages(IServiceCollection)

Belirtilen IServiceCollectionöğesine sayfalar için hizmetler ekler.

public static Microsoft.Extensions.DependencyInjection.IMvcBuilder AddRazorPages (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddRazorPages : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
<Extension()>
Public Function AddRazorPages (services As IServiceCollection) As IMvcBuilder

Parametreler

services
IServiceCollection

IServiceCollection hizmet eklenecek.

Döndürülenler

IMvcBuilder MVC hizmetlerini daha fazla yapılandırmak için kullanılabilecek bir.

Açıklamalar

Bu yöntem, sayfalar için yaygın olarak kullanılan özellikler için MVC hizmetlerini yapılandırıyor. Bu, , , AddRazorPages(IMvcCoreBuilder)AddCacheTagHelper(IMvcCoreBuilder)AddDataAnnotations(IMvcCoreBuilder)AddAuthorization(IMvcCoreBuilder)ve etkilerini AddMvcCore(IServiceCollection)birleştirir.

API'ler için denetleyicilere yönelik hizmetler eklemek için çağrısı yapılır AddControllers(IServiceCollection).

Görünümlere sahip denetleyicilere yönelik hizmetler eklemek için çağrısı yapılır AddControllersWithViews(IServiceCollection).

Şunlara uygulanır

AddRazorPages(IServiceCollection, Action<RazorPagesOptions>)

Belirtilen IServiceCollectionöğesine sayfalar için hizmetler ekler.

public static Microsoft.Extensions.DependencyInjection.IMvcBuilder AddRazorPages (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions> configure);
public static Microsoft.Extensions.DependencyInjection.IMvcBuilder AddRazorPages (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions>? configure);
static member AddRazorPages : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Mvc.RazorPages.RazorPagesOptions> -> Microsoft.Extensions.DependencyInjection.IMvcBuilder
<Extension()>
Public Function AddRazorPages (services As IServiceCollection, configure As Action(Of RazorPagesOptions)) As IMvcBuilder

Parametreler

services
IServiceCollection

IServiceCollection hizmet eklenecek.

configure
Action<RazorPagesOptions>

Sağlanan MvcOptionsöğesini yapılandırmak için .Action<T>

Döndürülenler

IMvcBuilder MVC hizmetlerini daha fazla yapılandırmak için kullanılabilecek bir.

Açıklamalar

Bu yöntem, sayfalar için yaygın olarak kullanılan özellikler için MVC hizmetlerini yapılandırıyor. Bu, , , AddRazorPages(IMvcCoreBuilder)AddCacheTagHelper(IMvcCoreBuilder)AddDataAnnotations(IMvcCoreBuilder)AddAuthorization(IMvcCoreBuilder)ve etkilerini AddMvcCore(IServiceCollection)birleştirir.

API'ler için denetleyicilere yönelik hizmetler eklemek için çağrısı yapılır AddControllers(IServiceCollection).

Görünümlere sahip denetleyicilere yönelik hizmetler eklemek için çağrısı yapılır AddControllersWithViews(IServiceCollection).

Şunlara uygulanır