Skip to content

Commit 3c1b79d

Browse files
MoienTajikMarkPieszak
authored andcommitted
refactor: edited documentation and used best practices in asp.net core
* Edited project documentation as it uses .NET Core 2.2 * Removed unused files and section and used some coding conventions * Removed unused sections and used coding conventions for back-end side
1 parent a3c5e9c commit 3c1b79d

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

content/Controllers/WeatherController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace Vue2Spa.Controllers
77
[Route("api/[controller]")]
88
public class WeatherController : Controller
99
{
10-
private readonly IWeatherProvider weatherProvider;
10+
private readonly IWeatherProvider _weatherProvider;
1111

1212
public WeatherController(IWeatherProvider weatherProvider)
1313
{
14-
this.weatherProvider = weatherProvider;
14+
_weatherProvider = weatherProvider;
1515
}
1616

1717
[HttpGet("[action]")]
@@ -31,7 +31,7 @@ public IActionResult Forecasts([FromQuery(Name = "from")] int from = 0, [FromQue
3131
return BadRequest("You cannot go in the negative with the 'from' parameter");
3232
}
3333

34-
var allForecasts = weatherProvider.GetForecasts();
34+
var allForecasts = _weatherProvider.GetForecasts();
3535
var result = new
3636
{
3737
Total = allForecasts.Count,

content/Providers/WeatherProviderFake.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Vue2Spa.Providers
77
{
88
public class WeatherProviderFake : IWeatherProvider
99
{
10-
private readonly string[] summaries = {
10+
private readonly string[] _summaries = {
1111
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
1212
};
1313

@@ -25,7 +25,7 @@ private void Initialize(int quantity)
2525
{
2626
DateFormatted = DateTime.Now.AddDays(index).ToString("d"),
2727
TemperatureC = rng.Next(-20, 55),
28-
Summary = summaries[rng.Next(summaries.Length)]
28+
Summary = _summaries[rng.Next(_summaries.Length)]
2929
}).ToList();
3030
}
3131

content/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _Looking for ASP.NET Core & Angular 7.x+ Universal starter? [click here](https:/
2323

2424
# Features
2525

26-
- **ASP.NET Core 2.1**
26+
- **ASP.NET Core 2.2**
2727
- Web API
2828
- **VueJS 2**
2929
- Vuex (State Store)
@@ -32,7 +32,7 @@ _Looking for ASP.NET Core & Angular 7.x+ Universal starter? [click here](https:/
3232
- **Bootstrap 4**
3333

3434
# Prerequisites:
35-
* [.Net Core 2.1](https://www.microsoft.com/net/download/windows)
35+
* [.Net Core 2.2](https://www.microsoft.com/net/download/windows)
3636
* [NodeJS](https://nodejs.org/) >= 8.9.4
3737
* [VSCode](https://code.visualstudio.com/) (ideally), or VS2017
3838

content/Startup.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.AspNetCore.SpaServices.Webpack;
55
using Microsoft.Extensions.Configuration;
66
using Microsoft.Extensions.DependencyInjection;
7+
using Vue2Spa.Providers;
78

89
namespace Vue2Spa
910
{
@@ -24,7 +25,7 @@ public void ConfigureServices(IServiceCollection services)
2425
.SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
2526

2627
// Simple example with dependency injection for a data provider.
27-
services.AddSingleton<Providers.IWeatherProvider, Providers.WeatherProviderFake>();
28+
services.AddSingleton<IWeatherProvider, WeatherProviderFake>();
2829
}
2930

3031
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

content/appsettings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"ConnectionStrings": {},
32
"Logging": {
43
"LogLevel": {
54
"Default": "Warning"

content/global.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)