From 41857a9ccecf02381691fa95772633d126877061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=B6nbach?= Date: Thu, 28 May 2020 08:56:45 +0200 Subject: [PATCH 1/4] =?UTF-8?q?.gitignore-Datei=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 783 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 783 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae426e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,783 @@ + +# Created by https://www.gitignore.io/api/git,rider,linux,csharp,windows,dotnetcore,aspnetcore,visualstudio,visualstudiocode +# Edit at https://www.gitignore.io/?templates=git,rider,linux,csharp,windows,dotnetcore,aspnetcore,visualstudio,visualstudiocode + +### ASPNETCore ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/ + +### Csharp ### +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser + +# User-specific files (MonoDevelop/Xamarin Studio) + +# Mono auto generated files +mono_crash.* + +# Build results +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ + +# Visual Studio 2015/2017 cache/options directory +# Uncomment if you have tasks that create the project's static files in wwwroot + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results + +# NUnit +nunit-*.xml + +# Build Results of an ATL Project + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_h.h +*.iobj +*.ipdb +*_wpftmp.csproj + +# Chutzpah Test files + +# Visual C++ cache files + +# Visual Studio profiler + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace + +# Guidance Automation Toolkit + +# ReSharper is a .NET coding add-in + +# JustCode is a .NET coding add-in + +# TeamCity is a build add-in + +# DotCover is a Code Coverage Tool + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results + +# NCrunch + +# MightyMoose + +# Web workbench (sass) + +# Installshield output folder + +# DocProject is a documentation generator add-in + +# Click-Once directory + +# Publish Web Output +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted + +# NuGet Packages +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files + +# Microsoft Azure Build Output + +# Microsoft Azure Emulator + +# Windows Store app package directories and files +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) + +# RIA/Silverlight projects + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.ndf + +# Business Intelligence projects +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes + +# GhostDoc plugin setting file + +# Node.js Tools for Visual Studio + +# Visual Studio 6 build log + +# Visual Studio 6 workspace options file + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output + +# Paket dependency manager + +# FAKE - F# Make + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +### DotnetCore ### +# .NET Core build folders +/bin +/obj + +# Common node modules locations +/node_modules +/wwwroot/node_modules + + +### Git ### +# Created by git for backups. To disable backups in Git: +# $ git config --global mergetool.keepBackup false +*.orig + +# Created by git when using merge tools for conflicts +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +*_BACKUP_*.txt +*_BASE_*.txt +*_LOCAL_*.txt +*_REMOTE_*.txt + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Rider ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +### VisualStudio ### + +# User-specific files + +# User-specific files (MonoDevelop/Xamarin Studio) + +# Mono auto generated files + +# Build results + +# Visual Studio 2015/2017 cache/options directory +# Uncomment if you have tasks that create the project's static files in wwwroot + +# Visual Studio 2017 auto generated files + +# MSTest test Results + +# NUnit + +# Build Results of an ATL Project + +# Benchmark Results + +# .NET Core + +# StyleCop + +# Files built by Visual Studio + +# Chutzpah Test files + +# Visual C++ cache files + +# Visual Studio profiler + +# Visual Studio Trace Files + +# TFS 2012 Local Workspace + +# Guidance Automation Toolkit + +# ReSharper is a .NET coding add-in + +# JustCode is a .NET coding add-in + +# TeamCity is a build add-in + +# DotCover is a Code Coverage Tool + +# AxoCover is a Code Coverage Tool + +# Visual Studio code coverage results + +# NCrunch + +# MightyMoose + +# Web workbench (sass) + +# Installshield output folder + +# DocProject is a documentation generator add-in + +# Click-Once directory + +# Publish Web Output +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted + +# NuGet Packages +# NuGet Symbol Packages +# The packages folder can be ignored because of Package Restore +# except build/, which is used as an MSBuild target. +# Uncomment if necessary however generally it will be regenerated when needed +# NuGet v3's project.json files produces more ignorable files + +# Microsoft Azure Build Output + +# Microsoft Azure Emulator + +# Windows Store app package directories and files + +# Visual Studio cache files +# files ending in .cache can be ignored +# but keep track of directories ending in .cache + +# Others + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) + +# RIA/Silverlight projects + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) + +# SQL Server files + +# Business Intelligence projects + +# Microsoft Fakes + +# GhostDoc plugin setting file + +# Node.js Tools for Visual Studio + +# Visual Studio 6 build log + +# Visual Studio 6 workspace options file + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) + +# Visual Studio LightSwitch build output + +# Paket dependency manager + +# FAKE - F# Make + +# CodeRush personal settings + +# Python Tools for Visual Studio (PTVS) + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio + +# Telerik's JustMock configuration file + +# BizTalk build output + +# OpenCover UI analysis results + +# Azure Stream Analytics local run output + +# MSBuild Binary and Structured Log + +# NVidia Nsight GPU debugger configuration file + +# MFractors (Xamarin productivity tool) working folder + +# Local History for Visual Studio + +# BeatPulse healthcheck temp database + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 + +# End of https://www.gitignore.io/api/git,rider,linux,csharp,windows,dotnetcore,aspnetcore,visualstudio,visualstudiocode + From 09bb449838abec9f66896c1097c688f285ce4a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=B6nbach?= Date: Thu, 28 May 2020 08:59:08 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Unn=C3=B6tige=20Dateien=20entfernt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- obj/BuecherwurmAPI.csproj.nuget.dgspec.json | 67 ------------------- obj/BuecherwurmAPI.csproj.nuget.g.props | 15 ----- obj/BuecherwurmAPI.csproj.nuget.g.targets | 6 -- obj/project.assets.json | 72 --------------------- obj/project.nuget.cache | 10 --- 5 files changed, 170 deletions(-) delete mode 100644 obj/BuecherwurmAPI.csproj.nuget.dgspec.json delete mode 100644 obj/BuecherwurmAPI.csproj.nuget.g.props delete mode 100644 obj/BuecherwurmAPI.csproj.nuget.g.targets delete mode 100644 obj/project.assets.json delete mode 100644 obj/project.nuget.cache 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 From d64c4fed672c0d2216333db29763fbc8142622d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=B6nbach?= Date: Thu, 28 May 2020 10:55:56 +0200 Subject: [PATCH 3/4] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit d155f8fb5b4af1b8ed569c4a535d9d94bce75b7f Author: Jonas Schönbach Date: Wed May 27 15:47:14 2020 +0200 LendController um DTO ergänzt commit 4afdb44e920592eab474f0bd7342b2b03d7f0252 Author: Jonas Schönbach Date: Wed May 27 14:31:46 2020 +0200 LendController um weitere Methoden ergänzt commit 1c8ec4b517d5f0d6dc202187a8d38f2b474654be Author: Jonas Schönbach Date: Wed May 27 11:22:29 2020 +0200 flexiblere Umsetzung des LendControllers durch Depedency-Injection commit d07c82f7490ed471ce3eb3833fec9a0c31efb23f Author: Jonas Schönbach Date: Wed May 27 10:42:15 2020 +0200 Überflüssige Dateien entfernt commit e22296617c15454aabfd187ce702423d5f9ee9e3 Author: Jonas Schönbach Date: Wed May 27 10:38:00 2020 +0200 Überflüssige Dateien entfernt commit 774c7be7a970e291d3ac659678db495252d331c2 Author: Jonas Schönbach Date: Wed May 27 10:33:53 2020 +0200 .gitignore-Datei berichtigt commit f00ecd503432f265bcc3a3c42b0eeba608b4c1c7 Author: Jonas Schönbach Date: Wed May 27 10:30:19 2020 +0200 .gitignore-Datei hinzugefügt commit fbe1e58a4733b356427655341a5d8e2296d80cf0 Author: Jonas Schönbach Date: Wed May 27 10:08:52 2020 +0200 Erster Zwischenstand für die Ausleihe-Schnittstelle (mit Mock-Data) api/leihvorgang -- gibt Liste aller Leihvorgänge zurück api/leihvorgang/{id} -- gibt bestimmten Leihvorgang zurück --- .gitignore | 4 ++ BuecherwurmAPI.csproj | 5 ++ Controllers/LendController.cs | 84 ++++++++++++++++++++++++ Controllers/WeatherForecastController.cs | 39 ----------- DTOs/LendRead.cs | 12 ++++ Data/ILendRepo.cs | 11 ++++ Data/MockLendRepo.cs | 26 ++++++++ Models/Lend.cs | 13 ++++ Profiles/LendProfile.cs | 14 ++++ Properties/launchSettings.json | 4 +- Startup.cs | 9 +++ WeatherForecast.cs | 15 ----- 12 files changed, 180 insertions(+), 56 deletions(-) create mode 100644 Controllers/LendController.cs delete mode 100644 Controllers/WeatherForecastController.cs create mode 100644 DTOs/LendRead.cs create mode 100644 Data/ILendRepo.cs create mode 100644 Data/MockLendRepo.cs create mode 100644 Models/Lend.cs create mode 100644 Profiles/LendProfile.cs delete mode 100644 WeatherForecast.cs diff --git a/.gitignore b/.gitignore index ae426e7..ec1b020 100644 --- a/.gitignore +++ b/.gitignore @@ -586,6 +586,7 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser +<<<<<<< HEAD ### VisualStudioCode ### .vscode/* !.vscode/settings.json @@ -780,4 +781,7 @@ $RECYCLE.BIN/ # Backup folder for Package Reference Convert tool in Visual Studio 2017 # End of https://www.gitignore.io/api/git,rider,linux,csharp,windows,dotnetcore,aspnetcore,visualstudio,visualstudiocode +======= +# End of https://www.gitignore.io/api/git,rider,linux,csharp,aspnetcore +>>>>>>> ControllerJonas 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/Controllers/LendController.cs b/Controllers/LendController.cs new file mode 100644 index 0000000..136b429 --- /dev/null +++ b/Controllers/LendController.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AutoMapper; +using BuecherwurmAPI.Data; +using BuecherwurmAPI.DTOs; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.JsonPatch; +using Microsoft.Extensions.Logging; +using BuecherwurmAPI.Models; + +namespace BuecherwurmAPI.Controllers +{ + [Route("api/leihvorgang")] + [ApiController] + public class LendController : ControllerBase + { + private readonly ILendRepo _repository; + private readonly IMapper _mapper; + + public LendController(ILendRepo repository, IMapper mapper) + { + _repository = repository; + _mapper = mapper; + } + + //GET api/leihvorgang + [HttpGet] + public ActionResult> LendsGet() + { + return Ok(_repository.GetAllLends()); + } + + //POST api/leihvorgang + [HttpPost] + public ActionResult LendsPost(Lend lend) + { + /* + Internally a lend is stored with an id + but the client shouldn't be allowed to set or change it + therefore the package 'AutoMapper' is used to prevent errors + that could happen when doing this task manually. + It takes the information from the client and maps it to the + corresponding internal object which then will be returned. + Furthermore it could be used to keep some attributes secret. + Another nice effect of this is that the implementation could be changed + while the interface could be retained by some minor changes in the code. + + DTO stands for Data Transfer Object + */ + var item = new Lend + { + Id = 256, + Customer = lend.Customer, + Returned = lend.Returned, + ItemId = lend.ItemId, + ReturnDate = lend.ReturnDate + }; + return Ok(item); + //return Ok(_mapper.Map(item)); + } + + //GET api/leihvorgang/{id} + [HttpGet("{id}")] + public ActionResult LendById(int id) + { + var lend = _repository.GetLendById(id); + return Ok(lend); + } + + //PATCH api/leihvorgang/{id} + [HttpPatch("{id}")] + public ActionResult LendPatchById(int id, JsonPatchDocument patchDocument) + { + var lend = _repository.GetLendById(id); + if (lend == null) + { + return NotFound(); + } + return Ok(); + } + } +} diff --git a/Controllers/WeatherForecastController.cs b/Controllers/WeatherForecastController.cs deleted file mode 100644 index 74bac7e..0000000 --- a/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; - -namespace BuecherwurmAPI.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/DTOs/LendRead.cs b/DTOs/LendRead.cs new file mode 100644 index 0000000..5813213 --- /dev/null +++ b/DTOs/LendRead.cs @@ -0,0 +1,12 @@ +using System; + +namespace BuecherwurmAPI.DTOs +{ + public class LendReadDTO + { + public int ItemId { get; set;} + public DateTime ReturnDate { get; set; } + public string Customer { get; set; } + public bool Returned { get; set; } + } +} \ No newline at end of file diff --git a/Data/ILendRepo.cs b/Data/ILendRepo.cs new file mode 100644 index 0000000..d392ae6 --- /dev/null +++ b/Data/ILendRepo.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; +using BuecherwurmAPI.Models; + +namespace BuecherwurmAPI.Data +{ + public interface ILendRepo + { + IEnumerable GetAllLends(); + Lend GetLendById(int id); + } +} \ No newline at end of file diff --git a/Data/MockLendRepo.cs b/Data/MockLendRepo.cs new file mode 100644 index 0000000..717342c --- /dev/null +++ b/Data/MockLendRepo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using BuecherwurmAPI.Models; + +namespace BuecherwurmAPI.Data +{ + public class MockLendRepo : ILendRepo + { + public IEnumerable GetAllLends() + { + var lends = new List + { + new Lend{Id = 1, Customer = "Nek0", ItemId = 1337, Returned = false, ReturnDate = DateTime.Now}, + new Lend{Id = 2, Customer = "Shrubbery", ItemId = 1975, Returned = false, ReturnDate = DateTime.Now}, + new Lend{Id = 3, Customer = "Felix", ItemId = 42, Returned = true, ReturnDate = DateTime.Now} + }; + + return lends; + } + + public Lend GetLendById(int id) + { + return new Lend{Id = 1, Customer = "Nek0", ItemId = 1337, Returned = false, ReturnDate = DateTime.Now}; + } + } +} \ No newline at end of file diff --git a/Models/Lend.cs b/Models/Lend.cs new file mode 100644 index 0000000..b740853 --- /dev/null +++ b/Models/Lend.cs @@ -0,0 +1,13 @@ +using System; + +namespace BuecherwurmAPI.Models +{ + public class Lend + { + public int Id { get; set; } + public int ItemId { get; set;} + public DateTime ReturnDate { get; set; } + public string Customer { get; set; } + public bool Returned { get; set; } + } +} \ No newline at end of file diff --git a/Profiles/LendProfile.cs b/Profiles/LendProfile.cs new file mode 100644 index 0000000..074931c --- /dev/null +++ b/Profiles/LendProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; +using BuecherwurmAPI.DTOs; +using BuecherwurmAPI.Models; + +namespace BuecherwurmAPI.Profiles +{ + public class LendProfile : Profile + { + public LendProfile() + { + CreateMap(); + } + } +} \ 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/WeatherForecast.cs b/WeatherForecast.cs deleted file mode 100644 index 7046a72..0000000 --- a/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace BuecherwurmAPI -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string Summary { get; set; } - } -} From 22e87cd58acb46c59a7c46bac1d9b41c8e6930aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=B6nbach?= Date: Thu, 28 May 2020 11:02:04 +0200 Subject: [PATCH 4/4] .gitignore-Datei berichtigt --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index ec1b020..ae426e7 100644 --- a/.gitignore +++ b/.gitignore @@ -586,7 +586,6 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser -<<<<<<< HEAD ### VisualStudioCode ### .vscode/* !.vscode/settings.json @@ -781,7 +780,4 @@ $RECYCLE.BIN/ # Backup folder for Package Reference Convert tool in Visual Studio 2017 # End of https://www.gitignore.io/api/git,rider,linux,csharp,windows,dotnetcore,aspnetcore,visualstudio,visualstudiocode -======= -# End of https://www.gitignore.io/api/git,rider,linux,csharp,aspnetcore ->>>>>>> ControllerJonas