Asp.Net Core 中的 [FromForm] 和 [FromBody] 有什么区别。我将使用其中之一作为 post 方法。如果我使用 FromForm,是否会出现安全问题?
我需要动态更改 LaginPath。我的项目中有自定义文化。如果语言是英语,LoginPath="/Login" 如果语言是土耳其语,LoginPath="/Oturum-Ac"
如何动态更改 LoginPath
你能给我代码示例如何覆盖/更改 CustomCulture 中的 CookieAuthenticationOptions
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Localization;
using Microsoft.EntityFrameworkCore;
using ECommerce.Entity;
using ECommerce.Repository.Abstract;
using System;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using ECommerce.WebUI.Infrastructure;
using System.IO;
using System.Text;
using ECommerce.WebUI.Areas.Admin.Infrastructure;
using System.Net;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore.Identity;
namespace ECommerce.WebUI.Infrastructure
{
public class CustomCulture
{
private readonly RequestDelegate _next;
private readonly ILogger<CustomCulture> _logger;
public CustomCulture(RequestDelegate next, ILogger<CustomCulture> logger)
{
_next = next;
_logger …Run Code Online (Sandbox Code Playgroud) asp.net-core ×2