Skip to content

Commit 58ff112

Browse files
authored
Merge branch 'loresoft:master' into master
2 parents 95321de + 303c09f commit 58ff112

File tree

67 files changed

+527
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+527
-260
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "01:00"
8+
open-pull-requests-limit: 10
9+
310
- package-ecosystem: nuget
411
directory: "/"
512
schedule:

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
tags:
9+
- 'v*'
10+
paths:
11+
- 'docs/**'
12+
- 'mkdocs.yml'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
29+
- name: Install mkdocs
30+
run: pip install mkdocs-material
31+
32+
- name: Build Documentation
33+
run: mkdocs build
34+
35+
- name: Upload Documentation
36+
if: success()
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
name: github-pages
40+
path: 'site/'
41+
42+
pages:
43+
runs-on: ubuntu-latest
44+
needs: build
45+
if: success()
46+
47+
permissions:
48+
pages: write
49+
id-token: write
50+
51+
steps:
52+
- name: Deploy Documentation
53+
id: deployment
54+
uses: actions/deploy-pages@v4
55+
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/dotnet.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Build
33
env:
44
DOTNET_NOLOGO: true
55
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
6+
DOTNET_ENVIRONMENT: github
67
ASPNETCORE_ENVIRONMENT: github
78
BUILD_PATH: '${{github.workspace}}/artifacts'
89
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
@@ -14,6 +15,9 @@ on:
1415
- develop
1516
tags:
1617
- 'v*'
18+
paths-ignore:
19+
- 'docs/**'
20+
- 'mkdocs.yml'
1721
pull_request:
1822
branches:
1923
- master
@@ -37,16 +41,16 @@ jobs:
3741

3842
steps:
3943
- name: Checkout
40-
uses: actions/checkout@v3
44+
uses: actions/checkout@v4
4145
with:
4246
fetch-depth: 0
4347

44-
- name: Install .NET Core
45-
uses: actions/setup-dotnet@v3
48+
- name: Install .NET
49+
uses: actions/setup-dotnet@v4
4650
with:
47-
dotnet-version: |
51+
dotnet-version: |
4852
6.0.x
49-
7.0.x
53+
8.0.x
5054
5155
- name: Restore Dependencies
5256
run: dotnet restore
@@ -55,29 +59,22 @@ jobs:
5559
run: dotnet build --no-restore --configuration Release
5660

5761
- name: Run Test
58-
run: dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
59-
60-
- name: Generate Coverage
61-
uses: danielpalme/[email protected]
62-
with:
63-
reports: '${{github.workspace}}/test/*/TestResults/*/coverage.info'
64-
targetdir: ${{env.BUILD_PATH}}
65-
reporttypes: lcov
62+
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings
6663

6764
- name: Report Coverage
6865
if: success()
6966
uses: coverallsapp/github-action@v2
7067
with:
71-
file: artifacts/lcov.info
72-
format: lcov
68+
file: "${{github.workspace}}/test/*/TestResults/*/coverage.info"
69+
format: lcov
7370

7471
- name: Create Packages
7572
if: success() && github.event_name != 'pull_request'
7673
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --no-restore --output "${{env.BUILD_PATH}}"
7774

7875
- name: Upload Packages
7976
if: success() && github.event_name != 'pull_request'
80-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
8178
with:
8279
name: packages
8380
path: '${{env.BUILD_PATH}}'
@@ -89,7 +86,7 @@ jobs:
8986

9087
steps:
9188
- name: Download Artifact
92-
uses: actions/download-artifact@v3
89+
uses: actions/download-artifact@v4
9390
with:
9491
name: packages
9592

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Replace `<ConnectionString>` with a valid database connection string.
4040

4141
### Generation Output
4242

43-
The `generate` command will create the follow files and directory structure by default. The root directory defaults to the current working directory. Most of the output names and locations can be customized in the [configuration file](https://efg.loresoft.com/en/latest/configuration/)
43+
The `generate` command will create the follow files and directory structure by default. The root directory defaults to the current working directory. Most of the output names and locations can be customized in the [configuration file](https://efg.loresoft.com/configuration/)
4444

4545
#### Data Context Output
4646

@@ -56,7 +56,7 @@ The mapping directory contains a fluent mapping class to map each entity to its
5656

5757
## Initialize Command
5858

59-
The `initialize` command is used to create the configuration yaml file and optionally set the [connection string](https://efg.loresoft.com/en/latest/connectionString/). The configuration file has many options to configure the generated output. See the [configuration file](https://efg.loresoft.com/en/latest/configuration/) documentation for more details.
59+
The `initialize` command is used to create the configuration yaml file and optionally set the [connection string](https://efg.loresoft.com/connectionString/). The configuration file has many options to configure the generated output. See the [configuration file](https://efg.loresoft.com/configuration/) documentation for more details.
6060

6161
The following command will create an initial `generation.yaml` configuration file as well as setting a user secret to store the connection string.
6262

@@ -129,7 +129,7 @@ Entity Framework Core Generator supports the following databases.
129129
- MySQL
130130
- Sqlite
131131

132-
The provider can be set via command line or via the [configuration file](https://efg.loresoft.com/en/latest/configuration/).
132+
The provider can be set via command line or via the [configuration file](https://efg.loresoft.com/configuration/).
133133

134134
Set via command line
135135

@@ -151,10 +151,17 @@ The database schema is loaded from the metadata model factory implementation of
151151

152152
## View Models
153153

154-
Entity Framework Core Generator supports generating [Read](https://efg.loresoft.com/en/latest/md/read/), [Create](https://efg.loresoft.com/en/latest/md/create/) and [Update](https://efg.loresoft.com/en/latest/md/update/) view models from an entity. Many projects rely on view models to shape data. The model templates can be used to quickly get the basic view models created. The model templates also support regeneration so any database change can easily be sync'd to the view models.
154+
Entity Framework Core Generator supports generating [Read](https://efg.loresoft.com/md/read/), [Create](https://efg.loresoft.com/md/create/) and [Update](https://efg.loresoft.com/md/update/) view models from an entity. Many projects rely on view models to shape data. The model templates can be used to quickly get the basic view models created. The model templates also support regeneration so any database change can easily be sync'd to the view models.
155155

156156
## Change Log
157157

158+
### Version 6.0
159+
160+
- upgrade to .net 8
161+
- add option to turn off temporal table mapping
162+
- add rowversion options, ByteArray|Long|ULong
163+
- add script template merge
164+
158165
### Version 5.0
159166

160167
- add support for navigation property renames

docs/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Options:
2020

2121
Example:
2222

23-
efg initialize initialize -c "Data Source=(local);Initial Catalog=Tracker;Integrated Security=True"
23+
efg initialize -c "Data Source=(local);Initial Catalog=Tracker;Integrated Security=True"
2424
```
2525

2626
## Generate Command
@@ -44,4 +44,4 @@ Options:
4444
Example:
4545

4646
efg generate
47-
```
47+
```

docs/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ data:
102102
directory: '{Project.Directory}\Data\Mapping' # the mapping class output directory
103103
#include XML documentation
104104
document: false
105+
106+
temporal: false # if temporal table mapping is enabled. Default true
107+
rowVersion: ByteArray|Long|ULong # How row versions should be mapped. Default ByteArray
105108

106109
# query extension class file configuration
107110
query:
@@ -191,6 +194,7 @@ script:
191194
namespace: '{Project.Namespace}.Domain.Context'
192195
baseClass: ContextScriptBase
193196
overwrite: true # overwrite existing file
197+
merge: true # merge regions with existing file
194198
# collection of script template with current Entity as a variable
195199
entity:
196200
- templatePath: '.\templates\entity.csx' # path to script file
@@ -199,6 +203,7 @@ script:
199203
namespace: '{Project.Namespace}.Domain.Entity'
200204
baseClass: EntityScriptBase
201205
overwrite: true # overwrite existing file
206+
merge: true # merge regions with existing file
202207
# collection script template with current Model as a variable
203208
model:
204209
- templatePath: '.\templates\model.csx' # path to script file
@@ -207,10 +212,12 @@ script:
207212
namespace: '{Project.Namespace}.Domain.Models'
208213
baseClass: ModelScriptBase
209214
overwrite: true # overwrite existing file
215+
merge: true # merge regions with existing file
210216
- templatePath: '.\templates\sample.csx' # path to script file
211217
fileName: '{Model.Name}Sample.cs' # filename to save script output
212218
directory: '{Project.Directory}\Domain\Models' # directory to save script output
213219
namespace: '{Project.Namespace}.Domain.Models'
214220
baseClass: ModelSampleBase
215221
overwrite: true # overwrite existing file
222+
merge: true # merge regions with existing file
216223
```

docs/connectionString.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ The `userSecretsId` can be shared with your .NET Core Project.
4545

4646
```XML
4747
<PropertyGroup>
48-
<TargetFramework>netcoreapp2.1</TargetFramework>
4948
<UserSecretsId>984ef0cf-2b22-4fd1-876d-e01499da4c1f</UserSecretsId>
5049
</PropertyGroup>
5150
```

docs/ef/mapping.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ The directory location to write the source file. *Variables Supported*
134134
135135
Include XML documentation for the generated class. Default: `false`
136136

137+
### temporal
138+
139+
If temporal table mapping is enabled. Default true
140+
141+
### rowVersion
142+
143+
How row versions should be mapped. Default ByteArray. ByteArray|Long|ULong
144+
137145
## Regeneration
138146

139147
The entity template has one region that is replaced on regeneration.

docs/scripts.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,14 @@ script:
185185
- templatePath: '.\Templates\entity-yaml.csx'
186186
fileName: '{Entity.Name}.yml'
187187
directory: '{Project.Directory}\Yaml\Entity'
188-
overwrite: true
188+
overwrite: false
189+
merge: true
189190
model:
190191
- templatePath: '.\Templates\model-yaml.csx'
191192
fileName: '{Model.Name}.yml'
192193
directory: '{Project.Directory}\Yaml\Model'
193-
overwrite: true
194+
overwrite: false
195+
merge: true
194196
```
195197
196198
### TemplatePath
@@ -216,3 +218,7 @@ The directory location to write script template output. *Variables Supported*
216218
#### Overwrite
217219
218220
Flag indicating whether to overwrite existing file. Default: `false`
221+
222+
#### Merge
223+
224+
Flag indicating whether to merge regions with existing file. Default: `false`

mkdocs.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
11
site_name: Entity Framework Core Generator
2-
theme: readthedocs
2+
theme: material
33
repo_url: https://github.com/loresoft/EntityFrameworkCore.Generator
44

5-
pages:
6-
- Home: index.md
5+
nav:
6+
- Home: index.md
77

8-
- Quick Start: quickStart.md
9-
- Database Connection: connectionString.md
10-
- Database Providers: providers.md
11-
- Regeneration: regeneration.md
12-
- Generation Configuration: configuration.md
13-
- Configuration Variables: variables.md
14-
- Command Line Reference: commands.md
8+
- Quick Start: quickStart.md
9+
- Database Connection: connectionString.md
10+
- Database Providers: providers.md
11+
- Regeneration: regeneration.md
12+
- Configuration File: configuration.md
13+
- Configuration Variables: variables.md
14+
- Command Line Reference: commands.md
1515

16-
- EntityFramework Templates:
17-
- Data Context: ef/dataContext.md
18-
- Entity: ef/entity.md
19-
- Mapping: ef/mapping.md
20-
- Extensions: ef/extensions.md
16+
- EntityFramework Templates:
17+
- Data Context: ef/dataContext.md
18+
- Entity: ef/entity.md
19+
- Mapping: ef/mapping.md
20+
- Extensions: ef/extensions.md
2121

22-
- Model Templates:
23-
- Shared Configuration: md/shared.md
24-
- Read Model: md/read.md
25-
- Create Model: md/create.md
26-
- Update Model: md/update.md
27-
- Validation: md/validation.md
28-
- Object Mapper: md/mapper.md
22+
- Model Templates:
23+
- Shared Configuration: md/shared.md
24+
- Read Model: md/read.md
25+
- Create Model: md/create.md
26+
- Update Model: md/update.md
27+
- Validation: md/validation.md
28+
- Object Mapper: md/mapper.md
2929

30-
- Script Templates: scripts.md
30+
- Script Templates: scripts.md
31+
32+
markdown_extensions:
33+
- tables
34+
- pymdownx.highlight:
35+
anchor_linenums: true
36+
line_spans: __span
37+
pygments_lang_class: true
38+
- pymdownx.inlinehilite
39+
- pymdownx.snippets
40+
- pymdownx.superfences

0 commit comments

Comments
 (0)