Skip to content
Open
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
14 changes: 7 additions & 7 deletions src/BuggyDemoConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

const int INDEX_RANGE = 10;
string arg0 = null;
string arg1 = string.Empty;
string arg1 = string.Empty;
string arg2 = "32.3";
int[] arg3 = new int[INDEX_RANGE];

Expand Down Expand Up @@ -50,7 +50,7 @@
// IsItNullOrNothing();
break;
case ConsoleKey.D4: //System Sql Exception

break;
case ConsoleKey.D5: //Argument Exception
ValidateThisValue(arg1);
Expand Down Expand Up @@ -108,10 +108,10 @@ static void MyExceptionIsBetterThanYours()
{
var people = new List<string> { "Mark Downie", "Mark Wilson-Thomas", "Andy Sterland", "Filisha Shah" };

if(!people.Exists(x => x.StartsWith("Harshada")))
if (!people.Exists(x => x.StartsWith("Harshada")))
{
throw new EmployeeNotFoundException("Harshada");
}
}
}

static async void DataDataBricksAndClay()
Expand Down Expand Up @@ -149,7 +149,7 @@ static int ValidateThisValue(string thevalue)
{
throw new ArgumentNullException(nameof(thevalue));
}

if (thevalue.Length == 0)
{
throw new ArgumentException("Zero-length string invalid", nameof(thevalue));
Expand All @@ -165,7 +165,7 @@ static int CanYouConvertThisValue(string age)

static void ArguingRarelyFixesAnything(int[] myarray)
{
if(myarray.Length >= INDEX_RANGE)
if (myarray.Length >= INDEX_RANGE)
{
throw new ArgumentOutOfRangeException(nameof(myarray), "Index is out of range.");
}
Expand All @@ -185,7 +185,7 @@ static int TheCastOfTheShowIncludes(object val)
static void TryingThisCerealItsGreat()
{
var resp = new MyDataResponse() { Message = "Some message...", Status = IntPtr.MinValue };

var str = JsonSerializer.Serialize(resp);

Console.WriteLine(str);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
 using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
Expand Down Expand Up @@ -88,7 +88,8 @@ public IActionResult StackOverflow()
{
legacyService.TypicalRecurrsionExample();

return Ok(); }
return Ok();
}

[HttpGet("crash/stack-overflow2")]
public IActionResult StackOverflow2()
Expand Down
2 changes: 1 addition & 1 deletion src/BuggyDemoWeb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private DiagnosticType SelectDiagnsticType(string route)
route = route.Split(@"/").FirstOrDefault();
switch (route)
{
case("crash"):
case ("crash"):
return DiagnosticType.Crash;
case ("exception"):
return DiagnosticType.Exceptions;
Expand Down
4 changes: 2 additions & 2 deletions src/BuggyDemoWeb/Controllers/MemoryLeakController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace BuggyDemoWeb.Controllers
public class MemoryLeakController : Controller
{
private IMemoryCache cache;
private static ConcurrentBag<string> _myListKeepsGrowing= new ConcurrentBag<string>();
private static ConcurrentBag<string> _myListKeepsGrowing = new ConcurrentBag<string>();

private readonly LegacyService legacyService;

Expand Down Expand Up @@ -76,7 +76,7 @@ public ActionResult<string> StringBuilderOOM()
legacyService.InsertIntoAStringBuilder();

return Ok();
}
}

/// <summary>
/// Create a 20k string and return it...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public IActionResult CreateDeadlockTaskYieldReturn()

return Ok();
}

[HttpGet("lowcpu/deadlocked-tasks-v4")]
public IActionResult MoneyTransfer()
{
Expand Down
4 changes: 2 additions & 2 deletions src/BuggyDemoWeb/Models/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ public class Account
{
public string Name { get; set; }

public decimal Balance { get; set; }
public decimal Balance { get; set; }

public int Id { get; set; }
public int Id { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/BuggyDemoWeb/Models/CustomerRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class CustomerRecord
{
public string FirstName { get; set; }
public string LastName { get; set; }
public Address Address { get; set; }
public Address Address { get; set; }
public int Id { get; set; }
}

Expand Down
2 changes: 1 addition & 1 deletion src/BuggyDemoWeb/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Extensions.Logging;

namespace BuggyDemoWeb
{
{
public class Program
{
public static void Main(string[] args)
Expand Down
10 changes: 5 additions & 5 deletions src/BuggyDemoWeb/Services/LegacyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class LegacyService
private readonly Uri connectionString;
static readonly HttpClient client = new HttpClient();

public LegacyService(IConfiguration config)
public LegacyService(IConfiguration config)
{
connectionString = new Uri(config.GetConnectionString("DataWebServer"));
}
Expand Down Expand Up @@ -223,7 +223,7 @@ public async Task<string> ValidateThisCollection()
var sb = new StringBuilder();
var list = new DataRecord();

await Task.Delay(1000);
await Task.Delay(1000);

foreach (var item in list.MyList)
{
Expand All @@ -243,12 +243,12 @@ public async Task<string> ValidateThisCollection()
}

public string ValidateAnotherCollection()
{
{
var customers = this.RetrieveCustomerData();

foreach (var customer in customers)
{
if(customer.Id > 300)
if (customer.Id > 300)
Console.WriteLine(this.CityAbbreviation(customer.Address.City));
}

Expand Down Expand Up @@ -323,7 +323,7 @@ public async Task<string> RetrieveRemoteData()

private List<CustomerRecord> RetrieveCustomerData()
{
return new List<CustomerRecord> {
return new List<CustomerRecord> {
new CustomerRecord { FirstName = "Peter", LastName = "Smith", Address = new Address { Address1 = "13", City = "", State = "" }, Id = 123 },
new CustomerRecord { FirstName = "Andrew", LastName = "Jones", Address = new Address { Address1 = "64", City = "", State = "" }, Id = 224 },
new CustomerRecord { FirstName = "John", LastName = "Guy", Address = new Address { Address1 = "54345", City = "", State = "" }, Id = 554 },
Expand Down
2 changes: 1 addition & 1 deletion src/BuggyDemoWeb/wwwroot/js/site.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Write your JavaScript code.
Loading