小编Zai*_*ari的帖子

将ASP.NET身份与核心域模型分离 - 洋葱架构

我使用这个示例项目(https://github.com/imranbaloch/ASPNETIdentityWithOnion)作为我的应用程序架构,在这个示例中,核心是从包括身份框架在内的基础设施中完全取消的.

在此示例中,作者使用适配器模式来分离核心标识类(IdentityUser,IdentityRole ...),并在Core层中提供类似它们的类.

现在这个示例项目中的问题是Domain模型(Product,Images)没有与模仿Identity模型的虚拟类(AppUser,ApplicationRole,AppliationUserRoles,...)链接.

然后我修改了代码以添加对AppUser的引用

public sealed class Image : BaseEntity
{
    public Image()
    {
        Products = new HashSet<Product>();
    }

    public string Path { get; set; }

    public AppUser AppUser { get; set; } // The  Added Reference ...

    public ICollection<Product> Products { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

如果我将"AppUser"导航属性放在"Image"类中,则创建的数据库将具有除标识框架的默认FIVE表之外的四个新表.

具有身份表的洋葱数据库问题

我需要将这些表合并为默认表.怎么样 ?

编辑:

这是驻留在数据层中的身份模型(我无法从核心引用).

public class ApplicationIdentityUser :
    IdentityUser<int, ApplicationIdentityUserLogin, ApplicationIdentityUserRole, ApplicationIdentityUserClaim>, IDomainUser {

    public ApplicationIdentityUser()
        : base() {
        Images = new HashSet<Image>();
    }

    public string Name { get; set; …
Run Code Online (Sandbox Code Playgroud)

.net onion-architecture entity-framework-6 asp.net-identity

10
推荐指数
1
解决办法
3116
查看次数

从电报机器人发送消息的限制是什么

我想了解 Telegram bot API 对消息发送施加的限制。

我知道目前您不能向不同的用户发送超过 30 条消息。

我有许多机器人在同一台服务器上运行(Webhooks 和 Pull Updates),它们会影响彼此的限制吗?

我还有一个多租户机器人,您可以注册许多机器人帐户,并且它将以相同的方式同时管理它们。

如果我使用不同的机器人帐户(令牌)发送消息但来自同一服务器,它是否将我限制为每个主机或每个机器人帐户 30 条消息?

telegram telegram-bot telegram-webhook

9
推荐指数
1
解决办法
2万
查看次数