Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a0d1fd2

Browse files
First commit
1 parent d6134d0 commit a0d1fd2

File tree

17 files changed

+767
-0
lines changed

17 files changed

+767
-0
lines changed

‎.gitignore

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
bld/
21+
[Bb]in/
22+
[Oo]bj/
23+
[Ll]og/
24+
25+
# Visual Studio 2015 cache/options directory
26+
.vs/
27+
# Uncomment if you have tasks that create the project's static files in wwwroot
28+
#wwwroot/
29+
30+
# MSTest test Results
31+
[Tt]est[Rr]esult*/
32+
[Bb]uild[Ll]og.*
33+
34+
# NUNIT
35+
*.VisualState.xml
36+
TestResult.xml
37+
38+
# Build Results of an ATL Project
39+
[Dd]ebugPS/
40+
[Rr]eleasePS/
41+
dlldata.c
42+
43+
# DNX
44+
project.lock.json
45+
project.fragment.lock.json
46+
artifacts/
47+
48+
*_i.c
49+
*_p.c
50+
*_i.h
51+
*.ilk
52+
*.meta
53+
*.obj
54+
*.pch
55+
*.pdb
56+
*.pgc
57+
*.pgd
58+
*.rsp
59+
*.sbr
60+
*.tlb
61+
*.tli
62+
*.tlh
63+
*.tmp
64+
*.tmp_proj
65+
*.log
66+
*.vspscc
67+
*.vssscc
68+
.builds
69+
*.pidb
70+
*.svclog
71+
*.scc
72+
73+
# Chutzpah Test files
74+
_Chutzpah*
75+
76+
# Visual C++ cache files
77+
ipch/
78+
*.aps
79+
*.ncb
80+
*.opendb
81+
*.opensdf
82+
*.sdf
83+
*.cachefile
84+
*.VC.db
85+
*.VC.VC.opendb
86+
87+
# Visual Studio profiler
88+
*.psess
89+
*.vsp
90+
*.vspx
91+
*.sap
92+
93+
# TFS 2012 Local Workspace
94+
$tf/
95+
96+
# Guidance Automation Toolkit
97+
*.gpState
98+
99+
# ReSharper is a .NET coding add-in
100+
_ReSharper*/
101+
*.[Rr]e[Ss]harper
102+
*.DotSettings.user
103+
104+
# JustCode is a .NET coding add-in
105+
.JustCode
106+
107+
# TeamCity is a build add-in
108+
_TeamCity*
109+
110+
# DotCover is a Code Coverage Tool
111+
*.dotCover
112+
113+
# Visual Studio code coverage results
114+
*.coverage
115+
*.coveragexml
116+
117+
# NCrunch
118+
_NCrunch_*
119+
.*crunch*.local.xml
120+
nCrunchTemp_*
121+
122+
# MightyMoose
123+
*.mm.*
124+
AutoTest.Net/
125+
126+
# Web workbench (sass)
127+
.sass-cache/
128+
129+
# Installshield output folder
130+
[Ee]xpress/
131+
132+
# DocProject is a documentation generator add-in
133+
DocProject/buildhelp/
134+
DocProject/Help/*.HxT
135+
DocProject/Help/*.HxC
136+
DocProject/Help/*.hhc
137+
DocProject/Help/*.hhk
138+
DocProject/Help/*.hhp
139+
DocProject/Help/Html2
140+
DocProject/Help/html
141+
142+
# Click-Once directory
143+
publish/
144+
145+
# Publish Web Output
146+
*.[Pp]ublish.xml
147+
*.azurePubxml
148+
# TODO: Comment the next line if you want to checkin your web deploy settings
149+
# but database connection strings (with potential passwords) will be unencrypted
150+
*.pubxml
151+
*.publishproj
152+
153+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
154+
# checkin your Azure Web App publish settings, but sensitive information contained
155+
# in these scripts will be unencrypted
156+
PublishScripts/
157+
158+
# NuGet Packages
159+
*.nupkg
160+
# The packages folder can be ignored because of Package Restore
161+
**/packages/*
162+
# except build/, which is used as an MSBuild target.
163+
!**/packages/build/
164+
# Uncomment if necessary however generally it will be regenerated when needed
165+
#!**/packages/repositories.config
166+
# NuGet v3's project.json files produces more ignoreable files
167+
*.nuget.props
168+
*.nuget.targets
169+
170+
# Microsoft Azure Build Output
171+
csx/
172+
*.build.csdef
173+
174+
# Microsoft Azure Emulator
175+
ecf/
176+
rcf/
177+
178+
# Windows Store app package directories and files
179+
AppPackages/
180+
BundleArtifacts/
181+
Package.StoreAssociation.xml
182+
_pkginfo.txt
183+
184+
# Visual Studio cache files
185+
# files ending in .cache can be ignored
186+
*.[Cc]ache
187+
# but keep track of directories ending in .cache
188+
!*.[Cc]ache/
189+
190+
# Others
191+
ClientBin/
192+
~$*
193+
*~
194+
*.dbmdl
195+
*.dbproj.schemaview
196+
*.jfm
197+
*.pfx
198+
*.publishsettings
199+
node_modules/
200+
orleans.codegen.cs
201+
202+
# Since there are multiple workflows, uncomment next line to ignore bower_components
203+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
204+
#bower_components/
205+
206+
# RIA/Silverlight projects
207+
Generated_Code/
208+
209+
# Backup & report files from converting an old project file
210+
# to a newer Visual Studio version. Backup files are not needed,
211+
# because we have git ;-)
212+
_UpgradeReport_Files/
213+
Backup*/
214+
UpgradeLog*.XML
215+
UpgradeLog*.htm
216+
217+
# SQL Server files
218+
*.mdf
219+
*.ldf
220+
221+
# Business Intelligence projects
222+
*.rdl.data
223+
*.bim.layout
224+
*.bim_*.settings
225+
226+
# Microsoft Fakes
227+
FakesAssemblies/
228+
229+
# GhostDoc plugin setting file
230+
*.GhostDoc.xml
231+
232+
# Node.js Tools for Visual Studio
233+
.ntvs_analysis.dat
234+
235+
# Visual Studio 6 build log
236+
*.plg
237+
238+
# Visual Studio 6 workspace options file
239+
*.opt
240+
241+
# Visual Studio LightSwitch build output
242+
**/*.HTMLClient/GeneratedArtifacts
243+
**/*.DesktopClient/GeneratedArtifacts
244+
**/*.DesktopClient/ModelManifest.xml
245+
**/*.Server/GeneratedArtifacts
246+
**/*.Server/ModelManifest.xml
247+
_Pvt_Extensions
248+
249+
# Paket dependency manager
250+
.paket/paket.exe
251+
paket-files/
252+
253+
# FAKE - F# Make
254+
.fake/
255+
256+
# JetBrains Rider
257+
.idea/
258+
*.sln.iml
259+
260+
# CodeRush
261+
.cr/
262+
263+
# Python Tools for Visual Studio (PTVS)
264+
__pycache__/
265+
*.pyc
266+
267+
# Cake - Uncomment if you are using it
268+
# tools/

‎.vscode/launch.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": ".NET Core Launch (web)",
9+
"type": "coreclr",
10+
"request": "launch",
11+
"preLaunchTask": "build",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.1/dockerapi.dll",
14+
"args": [],
15+
"cwd": "${workspaceFolder}",
16+
"stopAtEntry": false,
17+
"internalConsoleOptions": "openOnSessionStart",
18+
"launchBrowser": {
19+
"enabled": true,
20+
"args": "${auto-detect-url}",
21+
"windows": {
22+
"command": "cmd.exe",
23+
"args": "/C start ${auto-detect-url}"
24+
},
25+
"osx": {
26+
"command": "open"
27+
},
28+
"linux": {
29+
"command": "xdg-open"
30+
}
31+
},
32+
"env": {
33+
"ASPNETCORE_ENVIRONMENT": "Development"
34+
},
35+
"sourceFileMap": {
36+
"/Views": "${workspaceFolder}/Views"
37+
}
38+
},
39+
{
40+
"name": ".NET Core Attach",
41+
"type": "coreclr",
42+
"request": "attach",
43+
"processId": "${command:pickProcess}"
44+
}
45+
,]
46+
}

‎.vscode/tasks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/dockerapi.csproj"
11+
],
12+
"problemMatcher": "$msCompile"
13+
}
14+
]
15+
}

‎Controllers/BlogController.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using dockerapi.Models;
2+
using Microsoft.AspNetCore.Mvc;
3+
using System.Text.Encodings.Web;
4+
using System.Linq;
5+
namespace dockerapi.Controllers
6+
{
7+
[Route("api/[controller]")]
8+
[ApiController]
9+
#pragma warning disable CS1591
10+
public class BlogController : ControllerBase
11+
{
12+
private readonly ApiDbContext _context;
13+
14+
public BlogController(ApiDbContext context)
15+
{
16+
_context = context;
17+
}
18+
#pragma warning restore CS1591
19+
20+
/// <summary>
21+
/// This method shows all blogs
22+
/// </summary>
23+
/// <returns></returns>
24+
///<remarks>
25+
/// Sample request
26+
/// GET/Blog
27+
/// </remarks>
28+
[HttpGet]
29+
public object Get()
30+
{
31+
return _context.Blogs.Where(b => b.Title.Contains("Title")).Select((c) => new
32+
{
33+
Id = c.Id,
34+
Title = c.Title,
35+
Description = c.Description
36+
}).ToList();
37+
}
38+
39+
/// <summary>
40+
/// This method shows all blogs by title
41+
/// </summary>
42+
/// <param name="title"></param>
43+
/// <returns></returns>
44+
///<remarks>
45+
/// Sample request
46+
/// GET/Blog/title1
47+
/// </remarks>
48+
[HttpGet("{title}")]
49+
public object GetByTitle(string title)
50+
{
51+
return _context.Blogs.Where(b => b.Title == title).Select((c) => new
52+
{
53+
Id = c.Id,
54+
Title = c.Title,
55+
Description = c.Description
56+
}).ToList();
57+
}
58+
59+
}
60+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /