diff --git a/.vs/BuecherwurmAPI/config/applicationhost.config b/.vs/BuecherwurmAPI/config/applicationhost.config
deleted file mode 100644
index 136bd79..0000000
--- a/.vs/BuecherwurmAPI/config/applicationhost.config
+++ /dev/null
@@ -1,1027 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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vs/BuecherwurmAPI/v16/.suo b/.vs/BuecherwurmAPI/v16/.suo
deleted file mode 100644
index f995127..0000000
Binary files a/.vs/BuecherwurmAPI/v16/.suo and /dev/null differ
diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json
deleted file mode 100644
index f8b4888..0000000
--- a/.vs/ProjectSettings.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "CurrentProjectSetting": null
-}
\ No newline at end of file
diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite
deleted file mode 100644
index 58c5c17..0000000
Binary files a/.vs/slnx.sqlite and /dev/null differ
diff --git a/BuecherwurmAPI.csproj b/BuecherwurmAPI.csproj
index 400722f..cfb35fd 100644
--- a/BuecherwurmAPI.csproj
+++ b/BuecherwurmAPI.csproj
@@ -4,5 +4,10 @@
netcoreapp3.1
+
+
+
+
+
diff --git a/Models/Lend.cs b/Models/Lend.cs
index b740853..31abd2b 100644
--- a/Models/Lend.cs
+++ b/Models/Lend.cs
@@ -10,4 +10,4 @@ namespace BuecherwurmAPI.Models
public string Customer { get; set; }
public bool Returned { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json
index 106829e..fa2e929 100644
--- a/Properties/launchSettings.json
+++ b/Properties/launchSettings.json
@@ -12,7 +12,7 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
- "launchUrl": "weatherforecast",
+ "launchUrl": "api",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@@ -20,7 +20,7 @@
"BuecherwurmAPI": {
"commandName": "Project",
"launchBrowser": true,
- "launchUrl": "weatherforecast",
+ "launchUrl": "api",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
diff --git a/Startup.cs b/Startup.cs
index 1bdfe77..d9a3ef4 100644
--- a/Startup.cs
+++ b/Startup.cs
@@ -2,6 +2,8 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using AutoMapper;
+using BuecherwurmAPI.Data;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
@@ -26,6 +28,13 @@ namespace BuecherwurmAPI
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
+
+ // Adds a service that is created once per connection.
+ // It takes an interface and a specific implementation.
+ // That allows to swap the implementation easily.
+ services.AddScoped();
+
+ services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
diff --git a/obj/BuecherwurmAPI.csproj.nuget.dgspec.json b/obj/BuecherwurmAPI.csproj.nuget.dgspec.json
deleted file mode 100644
index 519046e..0000000
--- a/obj/BuecherwurmAPI.csproj.nuget.dgspec.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "format": 1,
- "restore": {
- "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj": {}
- },
- "projects": {
- "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj": {
- "version": "1.0.0",
- "restore": {
- "projectUniqueName": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj",
- "projectName": "BuecherwurmAPI",
- "projectPath": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj",
- "packagesPath": "/home/js/.nuget/packages/",
- "outputPath": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/obj/",
- "projectStyle": "PackageReference",
- "configFilePaths": [
- "/home/js/.nuget/NuGet/NuGet.Config"
- ],
- "originalTargetFrameworks": [
- "netcoreapp3.1"
- ],
- "sources": {
- "https://api.nuget.org/v3/index.json": {}
- },
- "frameworks": {
- "netcoreapp3.1": {
- "projectReferences": {}
- }
- },
- "warningProperties": {
- "warnAsError": [
- "NU1605"
- ]
- }
- },
- "frameworks": {
- "netcoreapp3.1": {
- "imports": [
- "net461",
- "net462",
- "net47",
- "net471",
- "net472",
- "net48"
- ],
- "assetTargetFallback": true,
- "warn": true,
- "downloadDependencies": [
- {
- "name": "Microsoft.AspNetCore.App.Ref",
- "version": "[3.1.2, 3.1.2]"
- }
- ],
- "frameworkReferences": {
- "Microsoft.AspNetCore.App": {
- "privateAssets": "none"
- },
- "Microsoft.NETCore.App": {
- "privateAssets": "all"
- }
- },
- "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/3.1.300/RuntimeIdentifierGraph.json"
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/obj/BuecherwurmAPI.csproj.nuget.g.props b/obj/BuecherwurmAPI.csproj.nuget.g.props
deleted file mode 100644
index db837e3..0000000
--- a/obj/BuecherwurmAPI.csproj.nuget.g.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- True
- NuGet
- $(MSBuildThisFileDirectory)project.assets.json
- /home/js/.nuget/packages/
- /home/js/.nuget/packages/
- PackageReference
- 5.6.0
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
-
\ No newline at end of file
diff --git a/obj/BuecherwurmAPI.csproj.nuget.g.targets b/obj/BuecherwurmAPI.csproj.nuget.g.targets
deleted file mode 100644
index 53cfaa1..0000000
--- a/obj/BuecherwurmAPI.csproj.nuget.g.targets
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
-
\ No newline at end of file
diff --git a/obj/project.assets.json b/obj/project.assets.json
deleted file mode 100644
index dcf1392..0000000
--- a/obj/project.assets.json
+++ /dev/null
@@ -1,72 +0,0 @@
-{
- "version": 3,
- "targets": {
- ".NETCoreApp,Version=v3.1": {}
- },
- "libraries": {},
- "projectFileDependencyGroups": {
- ".NETCoreApp,Version=v3.1": []
- },
- "packageFolders": {
- "/home/js/.nuget/packages/": {}
- },
- "project": {
- "version": "1.0.0",
- "restore": {
- "projectUniqueName": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj",
- "projectName": "BuecherwurmAPI",
- "projectPath": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj",
- "packagesPath": "/home/js/.nuget/packages/",
- "outputPath": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/obj/",
- "projectStyle": "PackageReference",
- "configFilePaths": [
- "/home/js/.nuget/NuGet/NuGet.Config"
- ],
- "originalTargetFrameworks": [
- "netcoreapp3.1"
- ],
- "sources": {
- "https://api.nuget.org/v3/index.json": {}
- },
- "frameworks": {
- "netcoreapp3.1": {
- "projectReferences": {}
- }
- },
- "warningProperties": {
- "warnAsError": [
- "NU1605"
- ]
- }
- },
- "frameworks": {
- "netcoreapp3.1": {
- "imports": [
- "net461",
- "net462",
- "net47",
- "net471",
- "net472",
- "net48"
- ],
- "assetTargetFallback": true,
- "warn": true,
- "downloadDependencies": [
- {
- "name": "Microsoft.AspNetCore.App.Ref",
- "version": "[3.1.2, 3.1.2]"
- }
- ],
- "frameworkReferences": {
- "Microsoft.AspNetCore.App": {
- "privateAssets": "none"
- },
- "Microsoft.NETCore.App": {
- "privateAssets": "all"
- }
- },
- "runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/3.1.300/RuntimeIdentifierGraph.json"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/obj/project.nuget.cache b/obj/project.nuget.cache
deleted file mode 100644
index b0958fd..0000000
--- a/obj/project.nuget.cache
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "version": 2,
- "dgSpecHash": "DQHTkigAmzaLDZvres1QqICGpp078kH+e2RcIw20S2aZ61FIcBBy9GnDIw6JTzZ4/RxJvQ1+WRFn2orctypbfA==",
- "success": true,
- "projectFilePath": "/home/js/git/BuecherwurmAPI/BuecherwurmAPI/BuecherwurmAPI.csproj",
- "expectedPackageFiles": [
- "/home/js/.nuget/packages/microsoft.aspnetcore.app.ref/3.1.2/microsoft.aspnetcore.app.ref.3.1.2.nupkg.sha512"
- ],
- "logs": []
-}
\ No newline at end of file