mirror of https://github.com/abpframework/abp.git
3 changed files with 46 additions and 1 deletions
@ -0,0 +1,23 @@ |
|||||
|
using System.Linq; |
||||
|
using Microsoft.AspNetCore.Http; |
||||
|
using Volo.Abp.MultiTenancy; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.MultiTenancy |
||||
|
{ |
||||
|
public class FormTenantResolveContributor : HttpTenantResolveContributorBase |
||||
|
{ |
||||
|
public const string ContributorName = "Form"; |
||||
|
|
||||
|
public override string Name => ContributorName; |
||||
|
|
||||
|
protected override string GetTenantIdOrNameFromHttpContextOrNull(ITenantResolveContext context, HttpContext httpContext) |
||||
|
{ |
||||
|
if (httpContext.Request == null || !httpContext.Request.Form.Any()) |
||||
|
{ |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
return httpContext.Request.Form[context.GetAbpAspNetCoreMultiTenancyOptions().TenantKey]; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue