Skip to content
Merged
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: 2 additions & 1 deletion CSharp/DP.Domain/DP.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NoWarn>$(NoWarn);SYSLIB0011</NoWarn>
</PropertyGroup>

</Project>
14 changes: 7 additions & 7 deletions CSharp/DP.UnitTest/DP.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<!-- <PackageReference Include="xunit.abstractions" Version="2.0.1" /> -->
<!-- <PackageReference Include="xunit.core" Version="2.3.0" /> -->
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 18 additions & 3 deletions CSharp/DP.UnitTest/Utility/XunitTraceListener.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Diagnostics;
using Xunit.Abstractions;

Expand All @@ -15,11 +16,25 @@ public XunitTraceListener(ITestOutputHelper output)
}
public override void Write(string message)
{
this._output.WriteLine(message);
try
{
this._output.WriteLine(message);
}
catch (InvalidOperationException)
{
// Ignore if there is no active test
}
}
public override void WriteLine(string message)
{
this._output.WriteLine(message);
{
try
{
this._output.WriteLine(message);
}
catch (InvalidOperationException)
{
// Ignore if there is no active test
}
}
}
}
10 changes: 1 addition & 9 deletions CSharp/DP.Website/DP.Website.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.1" />
</ItemGroup>

</Project>
16 changes: 11 additions & 5 deletions CSharp/DP.Website/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,34 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace DP.Website
{
public class Startup
{
public Startup(IConfiguration configuration)
private readonly IWebHostEnvironment _env;

public Startup(IWebHostEnvironment env)
{
Configuration = configuration;
_env = env;
}

public IConfiguration Configuration { get; }
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Configuration property is never assigned and will always be null. The constructor was changed to accept IWebHostEnvironment instead of IConfiguration, but the property wasn't updated accordingly. Either remove this unused property or add configuration injection to the constructor.

Copilot uses AI. Check for mistakes.

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddControllersWithViews(options =>
{
options.EnableEndpointRouting = false;
});
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app)
{
if (env.IsDevelopment())
if (_env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
Expand Down
6 changes: 3 additions & 3 deletions CSharp/DP.Website/Views/Home/Builder.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
for (int i = 0; i < Model.Parents.Count(); i++)
{
@Html.Partial("_ParentPartial", Model.Parents.ToList()[i])
<partial name="_ParentPartial" model="Model.Parents.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
Expand All @@ -17,7 +17,7 @@
{
for (int i = 0; i < Model.Children.Count(); i++)
{
@Html.Partial("_ChildPartial", Model.Children.ToList()[i])
<partial name="_ChildPartial" model="Model.Children.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
Expand All @@ -27,7 +27,7 @@
{
for (int i = 0; i < Model.Pets.Count(); i++)
{
@Html.Partial("_PetPartial", Model.Pets.ToList()[i])
<partial name="_PetPartial" model="Model.Pets.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
6 changes: 3 additions & 3 deletions CSharp/DP.Website/Views/Home/State.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
for (int i = 0; i < Model.Parents.Count(); i++)
{
@Html.Partial("_ParentPartial", Model.Parents.ToList()[i])
<partial name="_ParentPartial" model="Model.Parents.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
Expand All @@ -17,7 +17,7 @@
{
for (int i = 0; i < Model.Children.Count(); i++)
{
@Html.Partial("_ChildPartial", Model.Children.ToList()[i])
<partial name="_ChildPartial" model="Model.Children.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
Expand All @@ -27,7 +27,7 @@
{
for (int i = 0; i < Model.Pets.Count(); i++)
{
@Html.Partial("_PetPartial", Model.Pets.ToList()[i])
<partial name="_PetPartial" model="Model.Pets.ToList()[i]" />
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling ToList() inside the loop on every iteration is inefficient. The enumerable is materialized multiple times. Consider calling ToList() once before the loop and storing the result in a variable.

Copilot uses AI. Check for mistakes.
}
}
</div>
Loading