无效的租户名称 [英] Invalid Tenancy Name

查看:32
本文介绍了无效的租户名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事一个 ASP.NET Boilerplate 服务项目.

I am working on an ASP.NET Boilerplate service project.

当我保存客户端时,它返回一个错误:

When I am saving a client, it returns an error:

租户名称无效

租户名称包含空格.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.

nopoler4"TenancyNameRegex"^[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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆