Skip to content

Commit 59dfbb3

Browse files
committed
adding new project
1 parent 1dfe1b8 commit 59dfbb3

Some content is hidden

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

54 files changed

+39674
-0
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

AspNetRunBasicRealWorld.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28803.202
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetRunBasicRealWorld", "AspNetRunBasicRealWorld\AspNetRunBasicRealWorld.csproj", "{432A53F9-5AA6-44C6-B5B6-E29042604ACB}"
77
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspnetRunBasics", "AspnetRunBasics\AspnetRunBasics.csproj", "{2D734A3B-45D1-478A-8427-4CEA40C113E3}"
9+
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1012
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
1517
{432A53F9-5AA6-44C6-B5B6-E29042604ACB}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{432A53F9-5AA6-44C6-B5B6-E29042604ACB}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{432A53F9-5AA6-44C6-B5B6-E29042604ACB}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{2D734A3B-45D1-478A-8427-4CEA40C113E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{2D734A3B-45D1-478A-8427-4CEA40C113E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{2D734A3B-45D1-478A-8427-4CEA40C113E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{2D734A3B-45D1-478A-8427-4CEA40C113E3}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<UserSecretsId>cd5124f0-00bb-4cff-b8b9-dc4e11396fa3</UserSecretsId>
6+
<DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
11+
</ItemGroup>
12+
13+
14+
15+
</Project>

AspnetRunBasics/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
4+
#For more information, please see https://aka.ms/containercompat
5+
6+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-nanoserver-1709 AS base
7+
WORKDIR /app
8+
EXPOSE 80
9+
EXPOSE 443
10+
11+
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1709 AS build
12+
WORKDIR /src
13+
COPY ["AspnetRunBasics/AspnetRunBasics.csproj", "AspnetRunBasics/"]
14+
RUN dotnet restore "AspnetRunBasics/AspnetRunBasics.csproj"
15+
COPY . .
16+
WORKDIR "/src/AspnetRunBasics"
17+
RUN dotnet build "AspnetRunBasics.csproj" -c Release -o /app/build
18+
19+
FROM build AS publish
20+
RUN dotnet publish "AspnetRunBasics.csproj" -c Release -o /app/publish
21+
22+
FROM base AS final
23+
WORKDIR /app
24+
COPY --from=publish /app/publish .
25+
ENTRYPOINT ["dotnet", "AspnetRunBasics.dll"]

AspnetRunBasics/Pages/Error.cshtml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>

AspnetRunBasics/Pages/Error.cshtml.cs

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.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Mvc;
7+
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
using Microsoft.Extensions.Logging;
9+
10+
namespace AspnetRunBasics.Pages
11+
{
12+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
13+
public class ErrorModel : PageModel
14+
{
15+
public string RequestId { get; set; }
16+
17+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
18+
19+
private readonly ILogger<ErrorModel> _logger;
20+
21+
public ErrorModel(ILogger<ErrorModel> logger)
22+
{
23+
_logger = logger;
24+
}
25+
26+
public void OnGet()
27+
{
28+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
29+
}
30+
}
31+
}

AspnetRunBasics/Pages/Index.cshtml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@page
2+
@model IndexModel
3+
@{
4+
ViewData["Title"] = "Home page";
5+
}
6+
7+
<div class="text-center">
8+
<h1 class="display-4">Welcome</h1>
9+
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
10+
</div>

AspnetRunBasics/Pages/Index.cshtml.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
using Microsoft.Extensions.Logging;
8+
9+
namespace AspnetRunBasics.Pages
10+
{
11+
public class IndexModel : PageModel
12+
{
13+
private readonly ILogger<IndexModel> _logger;
14+
15+
public IndexModel(ILogger<IndexModel> logger)
16+
{
17+
_logger = logger;
18+
}
19+
20+
public void OnGet()
21+
{
22+
23+
}
24+
}
25+
}

AspnetRunBasics/Pages/Privacy.cshtml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page
2+
@model PrivacyModel
3+
@{
4+
ViewData["Title"] = "Privacy Policy";
5+
}
6+
<h1>@ViewData["Title"]</h1>
7+
8+
<p>Use this page to detail your site's privacy policy.</p>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
using Microsoft.Extensions.Logging;
8+
9+
namespace AspnetRunBasics.Pages
10+
{
11+
public class PrivacyModel : PageModel
12+
{
13+
private readonly ILogger<PrivacyModel> _logger;
14+
15+
public PrivacyModel(ILogger<PrivacyModel> logger)
16+
{
17+
_logger = logger;
18+
}
19+
20+
public void OnGet()
21+
{
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)