Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions GR.Mvc/.bowerrc

This file was deleted.

20 changes: 4 additions & 16 deletions GR.Mvc/GR.Mvc.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GR.Repository\GR.Repository.csproj" />
<ProjectReference Include="..\GR.Services\GR.Services.csproj" />
Expand Down
46 changes: 24 additions & 22 deletions GR.Mvc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using GR.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace GR.Mvc
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllersWithViews();
builder.Services.AddSingleton<ITicketService>(
new TicketService(builder.Configuration.GetConnectionString("MongoConnectionString")));

host.Run();
}
}
var app = builder.Build();

if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
Comment on lines +15 to 18

app.UseStaticFiles();
app.UseRouting();

app.MapControllerRoute(
name: "default",
pattern: "{controller=Ticket}/{action=Index}/{id?}");

app.Run();
21 changes: 3 additions & 18 deletions GR.Mvc/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:45765/",
"sslPort": 0
}
},
{
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"GR.Mvc": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:45766"
}
}
}
}
58 changes: 0 additions & 58 deletions GR.Mvc/Startup.cs

This file was deleted.

10 changes: 4 additions & 6 deletions GR.Mvc/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - GR.Mvc</title>

<environment names="Development">
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="~/css/site.css" />
</environment>
<environment names="Staging,Production">
<environment include="Staging,Production">
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
@Html.Raw(JavaScriptSnippet.FullScript)
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
Expand Down Expand Up @@ -47,12 +45,12 @@
</footer>
</div>

<environment names="Development">
<environment include="Development">
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<environment include="Staging,Production">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js"
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
asp-fallback-test="window.jQuery"
Expand Down
4 changes: 2 additions & 2 deletions GR.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<environment names="Development">
<environment include="Development">
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
</environment>
<environment names="Staging,Production">
<environment include="Staging,Production">
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
asp-fallback-test="window.jQuery && window.jQuery.validator"
Expand Down
3 changes: 1 addition & 2 deletions GR.Mvc/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
Comment on lines +1 to 5
Expand Down
9 changes: 4 additions & 5 deletions GR.Mvc/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
"Default": "Warning",
"Microsoft.AspNetCore": "Warning"
}
},

"ConnectionStrings": {
"MongoConnectionString": "{your mongodb connection string here}"
"MongoConnectionString": "mongodb://localhost:27017/GR"
}
}
10 changes: 0 additions & 10 deletions GR.Mvc/bower.json

This file was deleted.

24 changes: 0 additions & 24 deletions GR.Mvc/bundleconfig.json

This file was deleted.

10 changes: 6 additions & 4 deletions GR.Repository/GR.Repository.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MongoDB.Driver" Version="2.4.3" />
<PackageReference Include="MongoDB.Driver" Version="3.9.0" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion GR.Repository/Repository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static string BuildCollectionName()
entity.Version++;

var idFilter = Builders<T>.Filter.Eq(e => e.Id, entity.Id); //Find entity with same Id
var result = await Collection.ReplaceOneAsync(idFilter, entity, null, cancellationToken);
var result = await Collection.ReplaceOneAsync(idFilter, entity, (ReplaceOptions)null, cancellationToken);

if (result != null && ((result.IsAcknowledged && result.MatchedCount == 0) || (result.IsModifiedCountAvailable && !(result.ModifiedCount > 0))))
throw new EntityException(entity, "Entity does not exist.");
Expand Down
8 changes: 5 additions & 3 deletions GR.Services/GR.Services.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\GR.Repository\GR.Repository.csproj" />
</ItemGroup>

</Project>
</Project>
Loading