I'm trying to make a seed with some notification subscription but when I add NotificationSubscription entity to dbContext, like this:
public virtual IDbSet<NotificationSubscription> NotificationSubscription { get; set; }
this is what I got
EntityType 'NotificationSubscription' has no key defined. Define the key for this EntityType. NotificationSubscription: EntityType: EntitySet 'NotificationSubscription' is based on type 'NotificationSubscription' that has no keys defined.
Is there a way to do this?
thanks
2 Answer(s)
-
0
Hi,
Do you want to subscribe users to some notifications on your seed method ? If so, you should use UserNotificationInfo which is already included in the dbContext.
If you just want to create some notifications then you should use NotificationInfo.
-
0
it works thanks a lot