无效的租赁名称 [英] Invalid Tenancy Name
问题描述
我正在研究一个ASP.NET Boilerplate服务项目.
I am working on an ASP.NET Boilerplate service project.
当我保存一个客户端时,它返回一个错误:
When I am saving a client, it returns an error:
租户名称无效
Tenancy Name is not valid
租赁名称包含空格.
TenantDto
映射到Tenant
对象,没有任何错误.数据库表TenancyName
列为nvarchar(64)
.保存时发生错误.
The tenancy name contains spaces.
TenantDto
maps to Tenant
object without any error. Database table TenancyName
column is nvarchar(64)
. Error occurs when it is saving.
推荐答案
摘录自租户管理:
AbpTenant类定义了一些基本属性,最重要的是:
AbpTenant class defines some base properties, most important ones are:
- TenancyName :这是应用程序中租户的唯一名称.不应正常更改.它可用于将子域分配给租户,例如" mytenant .mydomain.com".租户. TenancyNameRegex 常数定义命名规则.
- 名称:租户的任意,易读的长名称.
- TenancyName: This is unique name of a tenant in the application. It should not be changed normally. It can be used to allocate subdomains to tenants like 'mytenant.mydomain.com'. Tenant.TenancyNameRegex constant defines the naming rule.
- Name: An arbitrary, human-readable, long name of the tenant.
是"^[a-zA-Z][a-zA-Z0-9_-]{1,}$"
,因为在子域中不允许使用空格.
TenancyNameRegex
is "^[a-zA-Z][a-zA-Z0-9_-]{1,}$"
as spaces are not allowed in subdomains.
如上所述,将Name
用作承租人的可读名称(带空格).
As quoted above, use Name
for the human-readable name (with spaces) of the tenant.
这篇关于无效的租赁名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!