Skip to content

Commit

Permalink
First commit !
Browse files Browse the repository at this point in the history
  • Loading branch information
aimenux committed Dec 23, 2023
1 parent 8cc2fde commit 4bc1b8c
Show file tree
Hide file tree
Showing 196 changed files with 8,341 additions and 49 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
51 changes: 2 additions & 49 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand All @@ -23,7 +23,6 @@ mono_crash.*
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
Expand Down Expand Up @@ -62,9 +61,6 @@ project.lock.json
project.fragment.lock.json
artifacts/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

Expand All @@ -90,7 +86,6 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -142,11 +137,6 @@ _TeamCity*
.axoCover/*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
*.coveragexml
Expand Down Expand Up @@ -294,17 +284,6 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -361,9 +340,6 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -372,27 +348,4 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
/.idea/.idea.RepositoryPatternDemo/.idea
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
[![.NET](https://github.com/aimenux/RepositoryPatternDemo/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/aimenux/RepositoryPatternDemo/actions/workflows/ci.yml)

# RepositoryPatternDemo
```
Using repository pattern with entity framework in web api projects
```

In this repo, i m exploring various ways of using repository pattern in web api projects
>
> :heavy_minus_sign: `Example01` use controller api with directly the db context
>
> :heavy_minus_sign: `Example02` use minimal api with directly the db context
>
> :heavy_minus_sign: `Example03` use controller api with specific repository
>
> :heavy_minus_sign: `Example04` use minimal api with specific repository
>
> :heavy_minus_sign: `Example05` use controller api with generic repository
>
> :heavy_minus_sign: `Example06` use minimal api with generic repository
>
> :heavy_minus_sign: `Example07` use controller api with generic repository & specific unit of work
>
> :heavy_minus_sign: `Example08` use minimal api with generic repository & specific unit of work
>
> :heavy_minus_sign: `Example09` use controller api with generic repository & generic unit of work
>
> :heavy_minus_sign: `Example10` use minimal api with generic repository & generic unit of work
>
> In order to setup the database, follow these steps for some example :
> - Run this docker command : `docker run -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=Pa55w0rd’ -p 1433:1433 -d mcr.microsoft.com/mssql/server`
> - Use this connection string : `"Data Source=localhost;Initial Catalog=BooksDB;User Id=sa;Password=Pa55w0rd;TrustServerCertificate=True;"`
> - Run database migrations : `dotnet-ef database update`
>
**`Tools`** : net 7.0, ef-core, xunit, fluent-assertions
156 changes: 156 additions & 0 deletions RepositoryPatternDemo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example01", "src\Example01\Example01.csproj", "{9A2FF466-E937-41FE-AA6C-287437672E84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example02", "src\Example02\Example02.csproj", "{CB76AC74-A2D8-4DC9-80B4-3B7BFC4E9348}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example03", "src\Example03\Example03.csproj", "{92109858-5DBD-424B-A983-332FEB4BAE5E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example04", "src\Example04\Example04.csproj", "{E9CF61FD-BF86-45C1-A253-546E6DCE320E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{502F13E3-A04C-4B47-B19C-2B70CFFB1444}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example01.Tests", "test\Example01.Tests\Example01.Tests.csproj", "{E92A813B-DB1B-4D9D-B938-486E4F048C10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example02.Tests", "test\Example02.Tests\Example02.Tests.csproj", "{C2F08763-EE3A-4C3F-898B-A3F7E3B87452}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example03.Tests", "test\Example03.Tests\Example03.Tests.csproj", "{773273BF-A79E-4888-8780-03903CB84AC0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1E3D2DBB-FBA5-4619-B315-8385F268CD41}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
.github\workflows\ci.yml = .github\workflows\ci.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example04.Tests", "test\Example04.Tests\Example04.Tests.csproj", "{5596BFB7-B338-48C2-A080-62EE0D67B1FB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example05", "src\Example05\Example05.csproj", "{FF88020A-F7CA-48C6-A2AE-E632FD8C2847}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example05.Tests", "test\Example05.Tests\Example05.Tests.csproj", "{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example06", "src\Example06\Example06.csproj", "{BDA7249B-F39A-4535-83CF-2FECA3155D62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example06.Tests", "test\Example06.Tests\Example06.Tests.csproj", "{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example07", "src\Example07\Example07.csproj", "{BFF63274-9414-44A1-B45E-BC96D0A17266}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example07.Tests", "test\Example07.Tests\Example07.Tests.csproj", "{9154871E-6F33-44E0-B54B-9EC31273C1C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example08", "src\Example08\Example08.csproj", "{1B5C53AB-0E01-4A9B-8465-74F5020C349C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example09", "src\Example09\Example09.csproj", "{800E22B4-D11C-4F0B-9245-B76E1535A08A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10", "src\Example10\Example10.csproj", "{2732E62E-D25B-49A1-B843-0FA93130AA06}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example08.Tests", "test\Example08.Tests\Example08.Tests.csproj", "{405E04E4-CB5C-484E-B8EE-8CD514F2CB01}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example09.Tests", "test\Example09.Tests\Example09.Tests.csproj", "{D7E4A737-04A0-4D34-8F40-44C48A5BD30A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example10.Tests", "test\Example10.Tests\Example10.Tests.csproj", "{75170121-E99D-4354-89B4-6B05F013D7D7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9A2FF466-E937-41FE-AA6C-287437672E84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9A2FF466-E937-41FE-AA6C-287437672E84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9A2FF466-E937-41FE-AA6C-287437672E84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9A2FF466-E937-41FE-AA6C-287437672E84}.Release|Any CPU.Build.0 = Release|Any CPU
{CB76AC74-A2D8-4DC9-80B4-3B7BFC4E9348}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB76AC74-A2D8-4DC9-80B4-3B7BFC4E9348}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB76AC74-A2D8-4DC9-80B4-3B7BFC4E9348}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB76AC74-A2D8-4DC9-80B4-3B7BFC4E9348}.Release|Any CPU.Build.0 = Release|Any CPU
{92109858-5DBD-424B-A983-332FEB4BAE5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92109858-5DBD-424B-A983-332FEB4BAE5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92109858-5DBD-424B-A983-332FEB4BAE5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92109858-5DBD-424B-A983-332FEB4BAE5E}.Release|Any CPU.Build.0 = Release|Any CPU
{E9CF61FD-BF86-45C1-A253-546E6DCE320E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9CF61FD-BF86-45C1-A253-546E6DCE320E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9CF61FD-BF86-45C1-A253-546E6DCE320E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9CF61FD-BF86-45C1-A253-546E6DCE320E}.Release|Any CPU.Build.0 = Release|Any CPU
{E92A813B-DB1B-4D9D-B938-486E4F048C10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E92A813B-DB1B-4D9D-B938-486E4F048C10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E92A813B-DB1B-4D9D-B938-486E4F048C10}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E92A813B-DB1B-4D9D-B938-486E4F048C10}.Release|Any CPU.Build.0 = Release|Any CPU
{C2F08763-EE3A-4C3F-898B-A3F7E3B87452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2F08763-EE3A-4C3F-898B-A3F7E3B87452}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2F08763-EE3A-4C3F-898B-A3F7E3B87452}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2F08763-EE3A-4C3F-898B-A3F7E3B87452}.Release|Any CPU.Build.0 = Release|Any CPU
{773273BF-A79E-4888-8780-03903CB84AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{773273BF-A79E-4888-8780-03903CB84AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{773273BF-A79E-4888-8780-03903CB84AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{773273BF-A79E-4888-8780-03903CB84AC0}.Release|Any CPU.Build.0 = Release|Any CPU
{5596BFB7-B338-48C2-A080-62EE0D67B1FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5596BFB7-B338-48C2-A080-62EE0D67B1FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5596BFB7-B338-48C2-A080-62EE0D67B1FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5596BFB7-B338-48C2-A080-62EE0D67B1FB}.Release|Any CPU.Build.0 = Release|Any CPU
{FF88020A-F7CA-48C6-A2AE-E632FD8C2847}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FF88020A-F7CA-48C6-A2AE-E632FD8C2847}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FF88020A-F7CA-48C6-A2AE-E632FD8C2847}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FF88020A-F7CA-48C6-A2AE-E632FD8C2847}.Release|Any CPU.Build.0 = Release|Any CPU
{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617}.Release|Any CPU.Build.0 = Release|Any CPU
{BDA7249B-F39A-4535-83CF-2FECA3155D62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDA7249B-F39A-4535-83CF-2FECA3155D62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDA7249B-F39A-4535-83CF-2FECA3155D62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDA7249B-F39A-4535-83CF-2FECA3155D62}.Release|Any CPU.Build.0 = Release|Any CPU
{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D}.Release|Any CPU.Build.0 = Release|Any CPU
{BFF63274-9414-44A1-B45E-BC96D0A17266}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFF63274-9414-44A1-B45E-BC96D0A17266}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFF63274-9414-44A1-B45E-BC96D0A17266}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFF63274-9414-44A1-B45E-BC96D0A17266}.Release|Any CPU.Build.0 = Release|Any CPU
{9154871E-6F33-44E0-B54B-9EC31273C1C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9154871E-6F33-44E0-B54B-9EC31273C1C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9154871E-6F33-44E0-B54B-9EC31273C1C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9154871E-6F33-44E0-B54B-9EC31273C1C0}.Release|Any CPU.Build.0 = Release|Any CPU
{1B5C53AB-0E01-4A9B-8465-74F5020C349C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B5C53AB-0E01-4A9B-8465-74F5020C349C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B5C53AB-0E01-4A9B-8465-74F5020C349C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B5C53AB-0E01-4A9B-8465-74F5020C349C}.Release|Any CPU.Build.0 = Release|Any CPU
{800E22B4-D11C-4F0B-9245-B76E1535A08A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{800E22B4-D11C-4F0B-9245-B76E1535A08A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{800E22B4-D11C-4F0B-9245-B76E1535A08A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{800E22B4-D11C-4F0B-9245-B76E1535A08A}.Release|Any CPU.Build.0 = Release|Any CPU
{2732E62E-D25B-49A1-B843-0FA93130AA06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2732E62E-D25B-49A1-B843-0FA93130AA06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2732E62E-D25B-49A1-B843-0FA93130AA06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2732E62E-D25B-49A1-B843-0FA93130AA06}.Release|Any CPU.Build.0 = Release|Any CPU
{405E04E4-CB5C-484E-B8EE-8CD514F2CB01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{405E04E4-CB5C-484E-B8EE-8CD514F2CB01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{405E04E4-CB5C-484E-B8EE-8CD514F2CB01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{405E04E4-CB5C-484E-B8EE-8CD514F2CB01}.Release|Any CPU.Build.0 = Release|Any CPU
{D7E4A737-04A0-4D34-8F40-44C48A5BD30A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7E4A737-04A0-4D34-8F40-44C48A5BD30A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7E4A737-04A0-4D34-8F40-44C48A5BD30A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7E4A737-04A0-4D34-8F40-44C48A5BD30A}.Release|Any CPU.Build.0 = Release|Any CPU
{75170121-E99D-4354-89B4-6B05F013D7D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75170121-E99D-4354-89B4-6B05F013D7D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75170121-E99D-4354-89B4-6B05F013D7D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75170121-E99D-4354-89B4-6B05F013D7D7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E92A813B-DB1B-4D9D-B938-486E4F048C10} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{C2F08763-EE3A-4C3F-898B-A3F7E3B87452} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{773273BF-A79E-4888-8780-03903CB84AC0} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{5596BFB7-B338-48C2-A080-62EE0D67B1FB} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{71FC51E5-1871-4D7E-BC27-2DCBFB7CC617} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{DA9DE5CE-F6E0-4352-AE61-0016EBC3028D} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{9154871E-6F33-44E0-B54B-9EC31273C1C0} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{405E04E4-CB5C-484E-B8EE-8CD514F2CB01} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{D7E4A737-04A0-4D34-8F40-44C48A5BD30A} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
{75170121-E99D-4354-89B4-6B05F013D7D7} = {502F13E3-A04C-4B47-B19C-2B70CFFB1444}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions src/Example01/Domain/Book.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Example01.Domain;

public record Book(int Id, string Title, string Author);
23 changes: 23 additions & 0 deletions src/Example01/Example01.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>Example01-UserSecrets</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Example01.Tests" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions src/Example01/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Example01;

public static class Extensions
{
public const string ContinuousIntegrationEnvironmentName = "CI-ENV";

public static bool IsContinuousIntegration(this IWebHostEnvironment environment)
{
return environment.IsEnvironment(ContinuousIntegrationEnvironmentName);
}
}
Loading

0 comments on commit 4bc1b8c

Please sign in to comment.