How to use a reference assembly for scaffolding

I have a class library with some model classes and a DbContext class (all of these classes are publicly available). This class library refers to the MVC-5 application.

Can I use model classes from this link class library for controller linings in this MVC-5 application?

When I use Controllers-Add-Controller-MVC controllers with views using the Entity Framework, in the dialog box, both the comboboxes for the Model class and the Data data class do not contain any elements. When I populate the full class name from the class reference library, the Add button is still disabled. What am I doing wrong?

enter image description here

+4
2

, dll , . , . , . ?

0

dll (, Entity Framework), .

, EF. , [] , .

, "" . [Key] ( EF dll).

, dbcontext , web.config.

-.

( ) , .

namespace ConsoleAdmin.Models
{
    [Table("ntf.tblNotification_ntf")]
    public class Notification : tblNotification_ntf
    {
        [Key]
        public new int notificationId { get; set; }
    }

    public class NotificationDbContext : DbContext
    {
        public NotificationDbContext(): base("name=bd_Soquij_logEntities") { }

        public DbSet<Notification> Notifications { get; set; }
    }
}
+1

Source: https://habr.com/ru/post/1607818/


All Articles