You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 months ago | |
|---|---|---|
| .. | ||
| LINGYUN/Abp/Notifications/EntityFrameworkCore | 2 months ago | |
| FodyWeavers.xml | 2 years ago | |
| FodyWeavers.xsd | 2 years ago | |
| LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj | 2 months ago | |
| README.EN.md | 1 year ago | |
| README.md | 1 year ago | |
README.md
LINGYUN.Abp.Notifications.EntityFrameworkCore
通知系统的EntityFrameworkCore模块,提供了通知系统的数据访问实现。
功能特性
- 通知实体映射配置
- 通知仓储实现
- 通知订阅仓储实现
- 支持多数据库
- 支持自定义仓储扩展
模块引用
[DependsOn(typeof(AbpNotificationsEntityFrameworkCoreModule))]
public class YouProjectModule : AbpModule
{
// other
}
实体映射
NotificationEfCoreEntityTypeConfiguration
- Notification - 通知实体映射
- Id - 主键映射
- NotificationName - 通知名称映射
- Data - 通知数据映射
- CreationTime - 创建时间映射
- Type - 通知类型映射
- Severity - 通知严重程度映射
NotificationSubscriptionEfCoreEntityTypeConfiguration
- NotificationSubscription - 通知订阅实体映射
- UserId - 用户标识映射
- NotificationName - 通知名称映射
- CreationTime - 创建时间映射
基本用法
- 配置DbContext
public class YourDbContext : AbpDbContext<YourDbContext>
{
public DbSet<Notification> Notifications { get; set; }
public DbSet<NotificationSubscription> NotificationSubscriptions { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigureNotifications();
}
}
- 配置连接字符串
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=YourDb;Trusted_Connection=True"
}
}