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
public class ClassC | |
{ | |
private string? _state; | |
public async Task<int> NotThreadSafe(string state) | |
{ | |
_state = state; | |
return _state.Length; | |
} | |
} |
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
using System.Threading.Tasks; | |
using Microsoft.Extensions.DependencyInjection; | |
using Shouldly; | |
using Xunit; | |
namespace Tests | |
{ | |
public class ScopedLifetimeTest | |
{ | |
[Fact] |
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
{ | |
"$type": "System.Collections.Generic.List`1[[System.String, System.Private.CoreLib]], System.Private.CoreLib", | |
"$values": [ | |
"CodeOpinion", | |
"Derek Comartin" | |
] | |
} |
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
{ | |
"$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib", | |
"$values": [ | |
"CodeOpinion", | |
"Derek Comartin" | |
] | |
} |
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
{ | |
"year": 2020, | |
"month": 6, | |
"day": 24, | |
"calendar": 0, | |
"nanoOfDay": 67807802138300, | |
"offsetSeconds": -14400, | |
"zone": "America/Detroit" | |
} |
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
{ | |
"Offset": { | |
"Seconds": -14400, | |
"Milliseconds": -14400000, | |
"Ticks": -144000000000, | |
"Nanoseconds": -14400000000000 | |
}, | |
"Zone": { | |
"Id": "America/Detroit", | |
"MinOffset": { |
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
using DotNetCore.CAP; | |
using Microsoft.Extensions.Logging; | |
namespace CAPDemo | |
{ | |
public class HelloWorldReceiver : ICapSubscribe | |
{ | |
private readonly ILogger<HelloWorldReceiver> _logger; | |
public HelloWorldReceiver(ILogger<HelloWorldReceiver> logger) |
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
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using DotNetCore.CAP; | |
using MySql.Data.MySqlClient; | |
namespace CAPDemo.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
private readonly ICapPublisher _capPublisher; |
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
using DotNetCore.CAP; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace CAPDemo | |
{ | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) |
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="DotNetCore.CAP" Version="3.0.4" /> | |
<PackageReference Include="DotNetCore.CAP.MySql" Version="3.0.4" /> | |
<PackageReference Include="DotNetCore.CAP.RabbitMQ" Version="3.0.4" /> |