Marked PageArgumentBinder type as Obsolete
This commit is contained in:
parent
09b5ff7b72
commit
e2b6975bff
|
|
@ -118,7 +118,9 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.TryAddSingleton<IPageHandlerMethodSelector, DefaultPageHandlerMethodSelector>();
|
services.TryAddSingleton<IPageHandlerMethodSelector, DefaultPageHandlerMethodSelector>();
|
||||||
|
|
||||||
// Page model binding
|
// Page model binding
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
services.TryAddSingleton<PageArgumentBinder, DefaultPageArgumentBinder>();
|
services.TryAddSingleton<PageArgumentBinder, DefaultPageArgumentBinder>();
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
|
||||||
// Action executors
|
// Action executors
|
||||||
services.TryAddSingleton<PageResultExecutor>();
|
services.TryAddSingleton<PageResultExecutor>();
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
|
namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
|
||||||
{
|
{
|
||||||
|
[Obsolete("This type is obsolete and will be removed in a future version.")]
|
||||||
public abstract class PageArgumentBinder
|
public abstract class PageArgumentBinder
|
||||||
{
|
{
|
||||||
public async Task<object> BindModelAsync(PageContext context, Type type, object @default, string name)
|
public async Task<object> BindModelAsync(PageContext context, Type type, object @default, string name)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,9 @@ using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
||||||
{
|
{
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
public class DefaultPageArgumentBinder : PageArgumentBinder
|
public class DefaultPageArgumentBinder : PageArgumentBinder
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
{
|
{
|
||||||
private readonly ParameterBinder _parameterBinder;
|
private readonly ParameterBinder _parameterBinder;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -327,14 +327,5 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Test.Internal
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MockBinder : PageArgumentBinder
|
|
||||||
{
|
|
||||||
protected override Task<ModelBindingResult> BindAsync(PageContext context, object value, string name, Type type)
|
|
||||||
{
|
|
||||||
var result = ModelBindingResult.Failed();
|
|
||||||
return Task.FromResult(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1942,13 +1942,5 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestPageArgumentBinder : PageArgumentBinder
|
|
||||||
{
|
|
||||||
protected override Task<ModelBindingResult> BindAsync(PageContext context, object value, string name, Type type)
|
|
||||||
{
|
|
||||||
return Task.FromResult(ModelBindingResult.Success(Guid.NewGuid()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue