Advertisement
Guest User

Untitled

a guest
May 31st, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. How EF design-time tooling will work
  2. ------------------------------------
  3. # Package structure
  4.  
  5. ```
  6. Microsoft.EntityFrameworkCore.Tools
  7. ├── lib
  8. │ ├── netcoreapp1.0
  9. │ | └── dotnet-ef.dll
  10. | ├── net451
  11. | | └── _._
  12. | └── netcore50
  13. | └── _._
  14. └── tools
  15. ├── EntityFrameworkCore.psm1
  16. └── net451
  17. | └── ef.exe
  18. └── netstandard1.3
  19. └── ef.dll
  20.  
  21. Microsoft.EntityFrameworkCore.*.Design
  22. --> depends on Microsoft.EntityFrameworkCore.Design
  23.  
  24. Microsoft.EntityFrameworkCore.Design
  25. └── lib
  26. └── netstandard1.3
  27. └── Microsoft.EntityFrameworkCore.Design.dll <-- OperationExecutor
  28. ```
  29.  
  30. # What's different
  31. - Users must have Microsoft.EntityFrameworkCore.*.Design for their provider.
  32. - PowerShell forwards to ef.exe on desktop.NET
  33. - .NET Core CLI and PowerShell share the OperationExecutor
  34. - ef.dll and ef.exe's only dependencies must be the BCL
  35.  
  36. # How command execution works
  37.  
  38. ## .NET Core CLI on .NET Core projects
  39.  
  40. ```
  41. > dotnet ef $ARGS
  42. └─ dotnet.exe \
  43. $NUGET_CACHE/dotnet-ef.dll \
  44. $ARGS
  45. |
  46. | (Gathers project model info)
  47. | (Resolves tool and app dependencies)
  48. | (Triggers a build)
  49. | (Launches the "inside man")
  50. |
  51. └─ dotnet exec \
  52. --runtimeconfig ef.runtimeconfig.json \
  53. --depsfile $appname.deps.json \
  54. $NUGET_CACHE/ef.dll \
  55. --assembly $full_path_to_appname.dll \
  56. $ARGS
  57. |
  58. | (Uses command line arguments to identify operation and options)
  59. |
  60. └─ OperationExecutor
  61. ```
  62.  
  63. ### What's different
  64.  
  65. - "dotnet ef" will execute `$NUPKG/tools/netstandard1.3/ef.dll`
  66. instead of `$BUILD_OUTPUT/Microsoft.EntityFrameworkCore.Tools.Cli.dll`.
  67. - Ms.EF.Tools no longer needs to be in dependencies
  68. - dotnet-ef.dll will need to resolve a framework to run and produce
  69. a runtimeconfig.json file
  70.  
  71. ## .NET Core CLI on .NET Core projects
  72.  
  73. ```
  74. > dotnet ef $ARGS
  75. └─ dotnet.exe \
  76. $NUGET_CACHE/dotnet-ef.dll \
  77. $ARGS
  78. |
  79. | (Gathers project model info)
  80. | (Resolves tool and app dependencies)
  81. | (Triggers a build)
  82. | (Launches the "inside man")
  83. |
  84. └─ $NUGET_CACHE/ef.exe \
  85. --config ef.exex.config \
  86. --assembly $full_path_to_appname.dll \
  87. $ARGS
  88. |
  89. | (Uses command line arguments to identify operation and options)
  90. | (Loads user app in sub app-domain)
  91. |
  92. └─ OperationExecutor
  93. ```
  94.  
  95. ### What's different
  96.  
  97. - "dotnet ef" will execute `$NUPKG/tools/netstandard1.3/ef.dll`
  98. instead of `$BUILD_OUTPUT/Microsoft.EntityFrameworkCore.Tools.Cli.exe`.
  99. - Ms.EF.Tools no longer needs to be in dependencies in addition to the *.Design assembly
  100.  
  101.  
  102. ## PowerShell on .NET Framework projects
  103.  
  104. ```
  105. PS > Add-Migration $ARGS
  106. └─ EntityFrameworkCore.psm1
  107. |
  108. | (Translates cmdlet arguments to dotnet-ef equivalent"
  109. |
  110. ├─ "ef.exe $ARGS --json"
  111. |
  112. └─ (Parse JSON results and trigger VS window opens)
  113. ```
  114.  
  115. ## What's different
  116.  
  117. - Powershell cmdlets's only job is to forward to ef.exe and parse json results
  118.  
  119. ## PowerShell on .NET Core projects
  120.  
  121. ```
  122. PS > Add-Migration $ARGS
  123. └─ EntityFrameworkCore.psm1
  124. |
  125. | (Translates cmdlet arguments to dotnet-ef equivalent"
  126. |
  127. ├─ "dotnet ef $ARGS --json"
  128. |
  129. └─ (Parse JSON results and trigger VS window opens)
  130. ```
  131.  
  132. ## What's different
  133.  
  134. - nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement