Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fix property assignment in primitives example #6355

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ public ConfigurationMonitor(IConfiguration config, IHostingEnvironment env)
{
_env = env;

ChangeToken.OnChange<string>(
ChangeToken.OnChange<IConfigurationMonitor>(
() => config.GetReloadToken(),
(state) => InvokeChanged(state),
"Not monitoring");
InvokeChanged,
this);
}

public bool MonitoringEnabled { get; set; } = false;
public string CurrentState { get; set; } = "Not monitoring";
#endregion

#region snippet3
private void InvokeChanged(string state)
private void InvokeChanged(IConfigurationMonitor state)
{
if (MonitoringEnabled)
{
Expand All @@ -48,13 +48,13 @@ private void InvokeChanged(string state)
if (!_appsettingsHash.SequenceEqual(appsettingsHash) ||
!_appsettingsEnvHash.SequenceEqual(appsettingsEnvHash))
{
state = $"State updated at {DateTime.Now}";
CurrentState = state;
string message = $"State updated at {DateTime.Now}";


_appsettingsHash = appsettingsHash;
_appsettingsEnvHash = appsettingsEnvHash;

WriteConsole($"Configuration changed (ConfigurationMonitor Class) {state}");
WriteConsole($"Configuration changed (ConfigurationMonitor Class) {message}, state:{state.CurrentState}");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" />
</ItemGroup>

</Project>

This file was deleted.

44 changes: 0 additions & 44 deletions aspnetcore/performance/caching/memory/sample/WebCache/project.json

This file was deleted.