EF 7 Migrations with multiple DBContexts

后端 未结 3 1535
夕颜
夕颜 2021-01-06 14:15

I have a problem scaffolding and doing migrations from a class library with multiple DBContexts. I found a command line argument that looks like this for migrations:

3条回答
  •  [愿得一人]
    2021-01-06 15:12

    The newest version (RC1 update 1) of the command line tools supports the following syntax:

    Usage: dnx ef dbcontext scaffold [arguments] [options]
    
    Arguments:
      [connection]  The connection string of the database
      [provider]    The provider to use. For example, EntityFramework.MicrosoftSqlServer
    
    Options:
      -a|--data-annotations                 Use DataAnnotation attributes to configure the model where possible. If omitted, the output code will use only the fluent API.
      -c|--context                    Name of the generated DbContext class.
      -o|--output-dir                 Directory of the project where the classes should be output. If omitted, the top-level project directory is used.
      -s|--schema   Selects a schema for which to generate classes.
      -t|--table    Selects a table for which to generate classes.
      -p|--target-project          The project to scaffold the model into. If omitted, the current project is used.
      -e|--environment         The environment to use. If omitted, "Development" is used.
      -v|--verbose                          Show verbose output
      -?|-h|--help                          Show help information
    

提交回复
热议问题