diff --git a/BlazorApp/AspNetCoreMVC/Controllers/HomeController.cs b/BlazorApp/AspNetCoreMVC/Controllers/HomeController.cs index 4fffe05..4e802a4 100644 --- a/BlazorApp/AspNetCoreMVC/Controllers/HomeController.cs +++ b/BlazorApp/AspNetCoreMVC/Controllers/HomeController.cs @@ -20,9 +20,30 @@ namespace AspNetCoreMVC.Controllers //return Redirect(url); - return RedirectToAction("Privacy"); + //return RedirectToAction("Privacy"); - //return View(); + return View(); + } + + public IActionResult Test(int id, [FromHeader] string value) + { + return null; + } + + public IActionResult Test2(TestModel testModel) + { + if (!ModelState.IsValid) + return RedirectToAction("Error"); + + return null; + } + + //1) names[0]=Faker&names[1]=Deft + //2) [0]=Faker&[1]=Deft + //3) names=Faker&names=Deft + public IActionResult Test3(List names) + { + return null; } public IActionResult Privacy() diff --git a/BlazorApp/AspNetCoreMVC/Models/Models.cs b/BlazorApp/AspNetCoreMVC/Models/Models.cs new file mode 100644 index 0000000..f749944 --- /dev/null +++ b/BlazorApp/AspNetCoreMVC/Models/Models.cs @@ -0,0 +1,13 @@ +using System.ComponentModel.DataAnnotations; + +namespace AspNetCoreMVC.Models +{ + public class TestModel + { + [Required] + public int Id { get; set; } + [Required] + [StringLength(20)] + public string Name { get; set; } + } +} diff --git a/BlazorApp/BlazorServerApp/BlazorServerApp.csproj b/BlazorApp/BlazorServerApp/BlazorServerApp.csproj index c78c9c7..b4bfd3f 100644 --- a/BlazorApp/BlazorServerApp/BlazorServerApp.csproj +++ b/BlazorApp/BlazorServerApp/BlazorServerApp.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -6,4 +6,16 @@ enable + + + $(DockerDefaultDockerfile) + + + + + + Always + + + diff --git a/BlazorApp/BlazorServerApp/Dockerfile b/BlazorApp/BlazorServerApp/Dockerfile new file mode 100644 index 0000000..131e9ad --- /dev/null +++ b/BlazorApp/BlazorServerApp/Dockerfile @@ -0,0 +1,7 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 +COPY . /app +WORKDIR /app +EXPOSE 80 +ENTRYPOINT ["dotnet", "BlazorServerApp.dll"] \ No newline at end of file diff --git a/BlazorApp/RankingApp/Dockerfile b/BlazorApp/RankingApp/Dockerfile new file mode 100644 index 0000000..c090105 --- /dev/null +++ b/BlazorApp/RankingApp/Dockerfile @@ -0,0 +1,7 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 +COPY . /app +WORKDIR /app +EXPOSE 80 +ENTRYPOINT ["dotnet", "RankingApp.dll"] \ No newline at end of file diff --git a/BlazorApp/RankingApp/RankingApp.csproj b/BlazorApp/RankingApp/RankingApp.csproj index b18c408..75a479d 100644 --- a/BlazorApp/RankingApp/RankingApp.csproj +++ b/BlazorApp/RankingApp/RankingApp.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,6 +7,12 @@ aspnet-RankingApp-4c431b3d-01c0-4833-aa25-9114e95a5131 + + + $(DockerDefaultDockerfile) + + + @@ -20,4 +26,10 @@ + + + Always + + +