Commit 2323f816 authored by nitroxis's avatar nitroxis

Updated .NET Core and ASP.NET Core.

parent a63a643c
......@@ -90,9 +90,17 @@ namespace UrlShortener.Controllers
[HttpPost]
public IActionResult Index(ShortenerModel model)
{
string longUri = model.LongUri;
model.ShortUri = this.shorten(longUri, out string error);
model.Error = error;
if (model.Email != null)
{
model.Error = "no u";
}
else
{
string longUri = model.LongUri;
model.ShortUri = this.shorten(longUri, out string error);
model.Error = error;
}
return this.View(model);
}
......
......@@ -10,5 +10,8 @@ namespace UrlShortener.Models
public string ShortUri { get; set; }
public string Error { get; set; }
[DataType(DataType.EmailAddress)]
public string Email { get; set; } = "";
}
}
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="2.6.362" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
<PackageReference Include="BuildBundlerMinifier" Version="2.8.391" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.4" />
</ItemGroup>
<ItemGroup>
......
......@@ -27,6 +27,9 @@
<input id="button" type="submit" class="btn btn-secondary" value="Shorten" />
</span>
</div>
<div class="pls-no-spam-thx">
<input asp-for="Email" class="form-control" />
</div>
</div>
</form>
......
......@@ -5,6 +5,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"]</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap-reboot.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment exclude="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap-reboot.min.css" />
<link rel="stylesheet" href="~/css/site.min.css" />
</environment>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap-reboot.min.css" />
<link rel="stylesheet" href="~/css/site.min.css" />
......@@ -13,7 +24,7 @@
<body>
<div class="container">
<h1>@ViewData["Title"]</h1>
@RenderBody()
</div>
<script src="~/lib/jQuery/dist/jquery.min.js"></script>
......
......@@ -3,10 +3,10 @@
"private": true,
"dependencies": {
"jQuery": "3.3.1",
"bootstrap": "v4.0.0"
"bootstrap": "v4.1.3"
},
"resolutions": {
"jQuery": "3.3.1",
"bootstrap": "v4.0.0"
"bootstrap": "v4.1.3"
}
}
body
{
padding-top: 50px;
padding-bottom: 20px;
padding-top: 50px;
padding-bottom: 20px;
}
.pls-no-spam-thx
{
display: none;
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment