Skip to content

Commit

Permalink
PlanBGmbH#91 Clean Up
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusMeyer13 committed Feb 26, 2020
1 parent bb12359 commit 0fdce7c
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
using System;
using System.Collections.Generic;
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using PlanB.Butler.Admin.Models;

namespace PlanB.Butler.Admin.Controllers
{
/// <summary>
/// HomeController.
/// </summary>
/// <seealso cref="Microsoft.AspNetCore.Mvc.Controller" />
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly ILogger<HomeController> logger;

/// <summary>
/// Initializes a new instance of the <see cref="HomeController"/> class.
/// </summary>
/// <param name="logger">The logger.</param>
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
this.logger = logger;
}

/// <summary>
/// Indexes this instance.
/// </summary>
/// <returns>IActionResult.</returns>
public IActionResult Index()
{
return View();
return this.View();
}

/// <summary>
/// Privacies this instance.
/// </summary>
/// <returns>Policy.</returns>
public IActionResult Privacy()
{
return View();
return this.View();
}

/// <summary>
/// Errors this instance.
/// </summary>
/// <returns>Error.</returns>
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
return this.View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? this.HttpContext.TraceIdentifier });
}
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
using System;
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
using Microsoft.AspNetCore.Mvc;

namespace PlanB.Butler.Admin.Controllers
{
/// <summary>
/// RestaurantController.
/// </summary>
/// <seealso cref="Microsoft.AspNetCore.Mvc.Controller" />
public class RestaurantController : Controller
{
// GET: /<controller>/

/// <summary>
/// Indexes this instance.
/// </summary>
/// <returns>Index.</returns>
public IActionResult Index()
{
return View();
return this.View();
}
}
}
20 changes: 19 additions & 1 deletion PlanB.Butler.Admin/PlanB.Butler.Admin/Models/ErrorViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System;

namespace PlanB.Butler.Admin.Models
{
/// <summary>
/// ErrorViewModel.
/// </summary>
public class ErrorViewModel
{
/// <summary>
/// Gets or sets the request identifier.
/// </summary>
/// <value>
/// The request identifier.
/// </value>
public string RequestId { get; set; }

public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
/// <summary>
/// Gets a value indicating whether to show request identifier.
/// </summary>
/// <value>
/// <c>true</c> if to show request identifier; otherwise, <c>false</c>.
/// </value>
public bool ShowRequestId => !string.IsNullOrEmpty(this.RequestId);
}
}
6 changes: 4 additions & 2 deletions PlanB.Butler.Admin/PlanB.Butler.Admin/Models/MealViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
Expand Down Expand Up @@ -67,5 +70,4 @@ public string Id
/// </value>
public string Restaurant { get; set; }
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
using System;
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace PlanB.Butler.Admin.Models
{
/// <summary>
/// RestaurantViewModel.
/// </summary>
public class RestaurantViewModel
{
/// <summary>
/// Gets the identifier.
/// Gets or sets the identifier.
/// </summary>
/// <value>
/// The identifier.
Expand Down Expand Up @@ -76,6 +82,5 @@ public string Id
/// The email adress.
/// </value>
public string EmailAdress { get; set; }

}
}
21 changes: 15 additions & 6 deletions PlanB.Butler.Admin/PlanB.Butler.Admin/Program.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
// Copyright (c) PlanB. GmbH. All Rights Reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace PlanB.Butler.Admin
{
/// <summary>
/// Program.
/// </summary>
public class Program
{
/// <summary>
/// Defines the entry point of the application.
/// </summary>
/// <param name="args">The arguments.</param>
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

/// <summary>
/// Creates the host builder.
/// </summary>
/// <param name="args">The arguments.</param>
/// <returns>IHostBuilder.</returns>
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MealService : IMealService
private readonly HttpClient httpClient;

/// <summary>
/// The configuration
/// The configuration.
/// </summary>
private readonly IConfiguration config;

Expand Down

0 comments on commit 0fdce7c

Please sign in to comment.