Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

Commit cd2deec

Browse files
pietersapMassimoC
authored andcommitted
Maturity level two (#89)
* copy maturity-level-one into maturity-level-two * Add empty line to fix markdown table * maturity level two * Update README.md empty guidelines - initial commit * Update CoditoRepository.cs private readonly
1 parent 4d8ef60 commit cd2deec

Some content is hidden

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

48 files changed

+2866
-1
lines changed

maturity-level-one/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Think about your operation URIs and make them as RESTy as possible – What we m
4949
- _Don't - `GET https://api.contoso.com/master-data/contracts/{contractId}?operation=cancel`_
5050

5151
### Versioning
52-
API versioning supports four methods of versioning out-of-the-box:
52+
53+
API versioning supports four methods of versioning out-of-the-box:
54+
5355
| Versioning | Example | Notes |
5456
|:--------|:-------------------|:-----|
5557
| by URL segment | https://api.contoso.com/master-data/v1/items/{itemId}| This URI-based resource versioning doesn't support a default or implicit matching of the current version. On the other hand is the simplest approach, the less error prone therefore the most used.|

maturity-level-two/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Practical API Guidelines - Should have
2+

maturity-level-two/src/.gitignore

Lines changed: 329 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
##
4+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5+
6+
# User-specific files
7+
*.suo
8+
*.user
9+
*.userosscache
10+
*.sln.docstates
11+
12+
# User-specific files (MonoDevelop/Xamarin Studio)
13+
*.userprefs
14+
15+
# Build results
16+
[Dd]ebug/
17+
[Dd]ebugPublic/
18+
[Rr]elease/
19+
[Rr]eleases/
20+
x64/
21+
x86/
22+
bld/
23+
[Bb]in/
24+
[Oo]bj/
25+
[Ll]og/
26+
27+
# Visual Studio 2015/2017 cache/options directory
28+
.vs/
29+
# Uncomment if you have tasks that create the project's static files in wwwroot
30+
#wwwroot/
31+
32+
# Visual Studio 2017 auto generated files
33+
Generated\ Files/
34+
35+
# MSTest test Results
36+
[Tt]est[Rr]esult*/
37+
[Bb]uild[Ll]og.*
38+
39+
# NUNIT
40+
*.VisualState.xml
41+
TestResult.xml
42+
43+
# Build Results of an ATL Project
44+
[Dd]ebugPS/
45+
[Rr]eleasePS/
46+
dlldata.c
47+
48+
# Benchmark Results
49+
BenchmarkDotNet.Artifacts/
50+
51+
# .NET Core
52+
project.lock.json
53+
project.fragment.lock.json
54+
artifacts/
55+
56+
# StyleCop
57+
StyleCopReport.xml
58+
59+
# Files built by Visual Studio
60+
*_i.c
61+
*_p.c
62+
*_i.h
63+
*.ilk
64+
*.meta
65+
*.obj
66+
*.iobj
67+
*.pch
68+
*.pdb
69+
*.ipdb
70+
*.pgc
71+
*.pgd
72+
*.rsp
73+
*.sbr
74+
*.tlb
75+
*.tli
76+
*.tlh
77+
*.tmp
78+
*.tmp_proj
79+
*.log
80+
*.vspscc
81+
*.vssscc
82+
.builds
83+
*.pidb
84+
*.svclog
85+
*.scc
86+
87+
# Chutzpah Test files
88+
_Chutzpah*
89+
90+
# Visual C++ cache files
91+
ipch/
92+
*.aps
93+
*.ncb
94+
*.opendb
95+
*.opensdf
96+
*.sdf
97+
*.cachefile
98+
*.VC.db
99+
*.VC.VC.opendb
100+
101+
# Visual Studio profiler
102+
*.psess
103+
*.vsp
104+
*.vspx
105+
*.sap
106+
107+
# Visual Studio Trace Files
108+
*.e2e
109+
110+
# TFS 2012 Local Workspace
111+
$tf/
112+
113+
# Guidance Automation Toolkit
114+
*.gpState
115+
116+
# ReSharper is a .NET coding add-in
117+
_ReSharper*/
118+
*.[Rr]e[Ss]harper
119+
*.DotSettings.user
120+
121+
# JustCode is a .NET coding add-in
122+
.JustCode
123+
124+
# TeamCity is a build add-in
125+
_TeamCity*
126+
127+
# DotCover is a Code Coverage Tool
128+
*.dotCover
129+
130+
# AxoCover is a Code Coverage Tool
131+
.axoCover/*
132+
!.axoCover/settings.json
133+
134+
# Visual Studio code coverage results
135+
*.coverage
136+
*.coveragexml
137+
138+
# NCrunch
139+
_NCrunch_*
140+
.*crunch*.local.xml
141+
nCrunchTemp_*
142+
143+
# MightyMoose
144+
*.mm.*
145+
AutoTest.Net/
146+
147+
# Web workbench (sass)
148+
.sass-cache/
149+
150+
# Installshield output folder
151+
[Ee]xpress/
152+
153+
# DocProject is a documentation generator add-in
154+
DocProject/buildhelp/
155+
DocProject/Help/*.HxT
156+
DocProject/Help/*.HxC
157+
DocProject/Help/*.hhc
158+
DocProject/Help/*.hhk
159+
DocProject/Help/*.hhp
160+
DocProject/Help/Html2
161+
DocProject/Help/html
162+
163+
# Click-Once directory
164+
publish/
165+
166+
# Publish Web Output
167+
*.[Pp]ublish.xml
168+
*.azurePubxml
169+
# Note: Comment the next line if you want to checkin your web deploy settings,
170+
# but database connection strings (with potential passwords) will be unencrypted
171+
*.pubxml
172+
*.publishproj
173+
174+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
175+
# checkin your Azure Web App publish settings, but sensitive information contained
176+
# in these scripts will be unencrypted
177+
PublishScripts/
178+
179+
# NuGet Packages
180+
*.nupkg
181+
# The packages folder can be ignored because of Package Restore
182+
**/[Pp]ackages/*
183+
# except build/, which is used as an MSBuild target.
184+
!**/[Pp]ackages/build/
185+
# Uncomment if necessary however generally it will be regenerated when needed
186+
#!**/[Pp]ackages/repositories.config
187+
# NuGet v3's project.json files produces more ignorable files
188+
*.nuget.props
189+
*.nuget.targets
190+
191+
# Microsoft Azure Build Output
192+
csx/
193+
*.build.csdef
194+
195+
# Microsoft Azure Emulator
196+
ecf/
197+
rcf/
198+
199+
# Windows Store app package directories and files
200+
AppPackages/
201+
BundleArtifacts/
202+
Package.StoreAssociation.xml
203+
_pkginfo.txt
204+
*.appx
205+
206+
# Visual Studio cache files
207+
# files ending in .cache can be ignored
208+
*.[Cc]ache
209+
# but keep track of directories ending in .cache
210+
!*.[Cc]ache/
211+
212+
# Others
213+
ClientBin/
214+
~$*
215+
*~
216+
*.dbmdl
217+
*.dbproj.schemaview
218+
*.jfm
219+
*.pfx
220+
*.publishsettings
221+
orleans.codegen.cs
222+
223+
# Including strong name files can present a security risk
224+
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
225+
#*.snk
226+
227+
# Since there are multiple workflows, uncomment next line to ignore bower_components
228+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
229+
#bower_components/
230+
231+
# RIA/Silverlight projects
232+
Generated_Code/
233+
234+
# Backup & report files from converting an old project file
235+
# to a newer Visual Studio version. Backup files are not needed,
236+
# because we have git ;-)
237+
_UpgradeReport_Files/
238+
Backup*/
239+
UpgradeLog*.XML
240+
UpgradeLog*.htm
241+
ServiceFabricBackup/
242+
*.rptproj.bak
243+
244+
# SQL Server files
245+
*.mdf
246+
*.ldf
247+
*.ndf
248+
249+
# Business Intelligence projects
250+
*.rdl.data
251+
*.bim.layout
252+
*.bim_*.settings
253+
*.rptproj.rsuser
254+
255+
# Microsoft Fakes
256+
FakesAssemblies/
257+
258+
# GhostDoc plugin setting file
259+
*.GhostDoc.xml
260+
261+
# Node.js Tools for Visual Studio
262+
.ntvs_analysis.dat
263+
node_modules/
264+
265+
# Visual Studio 6 build log
266+
*.plg
267+
268+
# Visual Studio 6 workspace options file
269+
*.opt
270+
271+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
272+
*.vbw
273+
274+
# Visual Studio LightSwitch build output
275+
**/*.HTMLClient/GeneratedArtifacts
276+
**/*.DesktopClient/GeneratedArtifacts
277+
**/*.DesktopClient/ModelManifest.xml
278+
**/*.Server/GeneratedArtifacts
279+
**/*.Server/ModelManifest.xml
280+
_Pvt_Extensions
281+
282+
# Paket dependency manager
283+
.paket/paket.exe
284+
paket-files/
285+
286+
# FAKE - F# Make
287+
.fake/
288+
289+
# JetBrains Rider
290+
.idea/
291+
*.sln.iml
292+
293+
# CodeRush
294+
.cr/
295+
296+
# Python Tools for Visual Studio (PTVS)
297+
__pycache__/
298+
*.pyc
299+
300+
# Cake - Uncomment if you are using it
301+
# tools/**
302+
# !tools/packages.config
303+
304+
# Tabs Studio
305+
*.tss
306+
307+
# Telerik's JustMock configuration file
308+
*.jmconfig
309+
310+
# BizTalk build output
311+
*.btp.cs
312+
*.btm.cs
313+
*.odx.cs
314+
*.xsd.cs
315+
316+
# OpenCover UI analysis results
317+
OpenCover/
318+
319+
# Azure Stream Analytics local run output
320+
ASALocalRun/
321+
322+
# MSBuild Binary and Structured Log
323+
*.binlog
324+
325+
# NVidia Nsight GPU debugger configuration file
326+
*.nvuser
327+
328+
# MFractors (Xamarin productivity tool) working folder
329+
.mfractor/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
6+
7+
namespace Codit.LevelTwo
8+
{
9+
public static class AutoMapperConfig
10+
{
11+
private static object _thisLock = new object();
12+
private static bool _initialized = false;
13+
14+
public static void Initialize()
15+
{
16+
lock (_thisLock)
17+
{
18+
if (!_initialized)
19+
{
20+
AutoMapper.Mapper.Initialize(mapperConfig =>
21+
{
22+
mapperConfig.CreateMap<Entities.Car, Models.CarDto>();
23+
mapperConfig.CreateMap<Entities.Customization, Models.CustomizationDto>();
24+
mapperConfig.CreateMap<Models.CustomizationDto, Entities.Customization>();
25+
});
26+
_initialized = true;
27+
}
28+
}
29+
}
30+
}
31+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<PropertyGroup>
3+
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<RootNamespace>Codit.LevelTwo</RootNamespace>
5+
<AssemblyName>Codit.LevelTwo</AssemblyName>
6+
</PropertyGroup>
7+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
8+
<DocumentationFile>Open-Api-Docs.xml</DocumentationFile>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="AutoMapper" Version="8.0.0" />
13+
<PackageReference Include="Ben.Demystifier" Version="0.1.3" />
14+
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
15+
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="2.2.0" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.0" />
17+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
18+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
19+
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
20+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" />
21+
</ItemGroup>
22+
</Project>

0 commit comments

Comments
 (0)