-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from davidtimovski/dev
Upgrade to .NET 8
- Loading branch information
Showing
15 changed files
with
123 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.1.0" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\TeamSketch\TeamSketch.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\TeamSketch\TeamSketch.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using TeamSketch.Web.Services; | ||
|
||
namespace TeamSketch.Web.Controllers | ||
namespace TeamSketch.Web.Controllers; | ||
|
||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class LiveViewController : ControllerBase | ||
{ | ||
[Route("api/[controller]")] | ||
[ApiController] | ||
public class LiveViewController : ControllerBase | ||
{ | ||
private readonly ILiveViewService _liveLiveService; | ||
private readonly ILiveViewService _liveLiveService; | ||
|
||
public LiveViewController(ILiveViewService liveViewService) | ||
{ | ||
_liveLiveService = liveViewService; | ||
} | ||
public LiveViewController(ILiveViewService liveViewService) | ||
{ | ||
_liveLiveService = liveViewService; | ||
} | ||
|
||
[HttpGet] | ||
public IActionResult Get() | ||
{ | ||
var locations = _liveLiveService.GetDistinctLocations(); | ||
return Ok(locations); | ||
} | ||
[HttpGet] | ||
public IActionResult Get() | ||
{ | ||
var locations = _liveLiveService.GetDistinctLocations(); | ||
return Ok(locations); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace TeamSketch.Web.Pages | ||
{ | ||
public class IndexModel : PageModel | ||
public class IndexModel(IConfiguration configuration) : PageModel | ||
{ | ||
public IndexModel(IConfiguration configuration) | ||
{ | ||
BaseUrl = configuration["BaseUrl"]; | ||
} | ||
|
||
public string BaseUrl { get; private set; } | ||
public string BaseUrl { get; private set; } = configuration["BaseUrl"]!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
namespace TeamSketch.Web.Persistence | ||
namespace TeamSketch.Web.Persistence; | ||
|
||
public class ConnectionRoom | ||
{ | ||
public class ConnectionRoom | ||
{ | ||
public int ConnectionId { get; set; } | ||
public string Nickname { get; set; } | ||
public int RoomId { get; set; } | ||
public string Room { get; set; } | ||
} | ||
public required int ConnectionId { get; init; } | ||
public required string Nickname { get; init; } | ||
public required int RoomId { get; init; } | ||
public required string Room { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
namespace TeamSketch.Web.Persistence | ||
namespace TeamSketch.Web.Persistence; | ||
|
||
public enum EventType | ||
{ | ||
public enum EventType | ||
{ | ||
Joined, | ||
Disconnected | ||
} | ||
Joined, | ||
Disconnected | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
|
||
namespace TeamSketch.Web.Utils | ||
namespace TeamSketch.Web.Utils; | ||
|
||
public static class RoomNameGenerator | ||
{ | ||
public static class RoomNameGenerator | ||
{ | ||
private static readonly char[] chars = "abcdefghkmnprstuvwxyz123456789".ToCharArray(); | ||
private const int Length = 7; | ||
private static readonly char[] chars = "abcdefghkmnprstuvwxyz123456789".ToCharArray(); | ||
private const int Length = 7; | ||
|
||
public static string Generate() | ||
public static string Generate() | ||
{ | ||
var data = new byte[4 * Length]; | ||
using (var crypto = RandomNumberGenerator.Create()) | ||
{ | ||
var data = new byte[4 * Length]; | ||
using (var crypto = RandomNumberGenerator.Create()) | ||
{ | ||
crypto.GetBytes(data); | ||
} | ||
|
||
var result = new StringBuilder(Length); | ||
for (int i = 0; i < Length; i++) | ||
{ | ||
var random = BitConverter.ToUInt32(data, i * 4); | ||
var index = random % chars.Length; | ||
crypto.GetBytes(data); | ||
} | ||
|
||
result.Append(chars[index]); | ||
} | ||
var result = new StringBuilder(Length); | ||
for (int i = 0; i < Length; i++) | ||
{ | ||
var random = BitConverter.ToUInt32(data, i * 4); | ||
var index = random % chars.Length; | ||
|
||
return result.ToString(); | ||
result.Append(chars[index]); | ||
} | ||
|
||
return result.ToString(); | ||
} | ||
} |
Oops, something went wrong.