Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #open domainmodel files in folder Model and iterate over the items...
- $files = (Get-Project $ProjectName).ProjectItems | Where-Object {$_.Name -eq "Model"} | ForEach{$_.ProjectItems }
- #activate each doc...
- $files | ForEach{$_.Open(); $_.Document.Activate()}
- Start-Sleep -s 2
- #Find all namespaces
- $namespaces = $DTE.Documents | ForEach{$_.ProjectItem.FileCodeModel.CodeElements | Where-Object{$_.Kind -eq 5}}
- #Find classes
- $classes = $namespaces | ForEach{$_.Children}
- #For each class scaffold only the ones inheriting "PersistentEntity"
- $classes | ForEach{
- $current = $_
- $_.Bases | ForEach{
- if($_.Name -eq "PersistentEntity"){
- Scaffold CodePlanner.ScaffoldBackend.For $current.Name -Force:$Force
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement