Entity Framework Core RC2 table name pluralization

前端 未结 7 2309
谎友^
谎友^ 2020-12-05 01:50

Is there a way to do what this code did in EF Core RC 2?

protected override void OnModelCreating(ModelBuilder modelBuilder)
{    
    modelBuilder.Convention         


        
7条回答
  •  心在旅途
    2020-12-05 02:21

    This is also an option:

     using System.ComponentModel.DataAnnotations.Schema;
    
     [Table("Book")]
     public class Book
     {...}
    

    although you need to annotate it on each entity

提交回复
热议问题