cloudnet-compose/result/dotnet/Result/Pages/Index.cshtml.cs

34 lines
916 B
C#
Raw Permalink Normal View History

2018-09-21 20:23:31 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
2018-09-26 11:29:39 +02:00
using Microsoft.Extensions.Configuration;
2018-09-21 20:23:31 +02:00
namespace Result.Pages
{
public class IndexModel : PageModel
{
2018-09-26 11:29:39 +02:00
private string _optionA;
private string _optionB;
protected readonly IConfiguration _configuration;
public string OptionA { get; private set; }
public string OptionB { get; private set; }
public IndexModel(IConfiguration configuration)
2018-09-21 20:23:31 +02:00
{
2018-09-26 11:29:39 +02:00
_configuration = configuration;
_optionA = _configuration.GetValue<string>("Voting:OptionA");
_optionB = _configuration.GetValue<string>("Voting:OptionB");
}
2018-09-21 20:23:31 +02:00
2018-09-26 11:29:39 +02:00
public void OnGet()
{
OptionA = _optionA;
OptionB = _optionB;
2018-09-21 20:23:31 +02:00
}
}
}