This commit is contained in:
parent
017f7a2e7b
commit
2ab8648a71
@ -21,7 +21,7 @@ namespace hanyadikhetvan
|
|||||||
|
|
||||||
public HanyadikHetVanDTO HanyadikHetVan()
|
public HanyadikHetVanDTO HanyadikHetVan()
|
||||||
{
|
{
|
||||||
return new HanyadikHetVanDTO();
|
return new HanyadikHetVanDTO(_configuration["HanyadikHetVan:StartDate"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,13 @@ namespace hanyadikhetvan.DTO
|
|||||||
{
|
{
|
||||||
public class HanyadikHetVanDTO
|
public class HanyadikHetVanDTO
|
||||||
{
|
{
|
||||||
public int HanyadikHet => (DateTime.Now - (DateTime.Parse(Environment.GetEnvironmentVariable("HANYADIKHET_STARTDATE")))).Days / 7;
|
private readonly DateTime startdate;
|
||||||
|
|
||||||
|
public HanyadikHetVanDTO(string startdate)
|
||||||
|
{
|
||||||
|
this.startdate = DateTime.Parse(startdate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int HanyadikHet => (DateTime.Now - startdate).Days / 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"HANYADIKHET_STARTDATE": "2021-02-08",
|
"HANYADIKHET_STARTDATE": "2021-02-08",
|
||||||
|
"HanyadikHetVan__StartDate": "2021-02-08",
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
},
|
},
|
||||||
"dotnetRunMessages": "true",
|
"dotnetRunMessages": "true",
|
||||||
|
@ -26,6 +26,7 @@ namespace hanyadikhetvan
|
|||||||
// This method gets called by the runtime. Use this method to add services to the container.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
// services.Configure<HanyadikHetVanService>(Configuration.GetSection("HanyadikHetVan"));
|
||||||
services.AddTransient<HanyadikHetVanService>();
|
services.AddTransient<HanyadikHetVanService>();
|
||||||
services.AddControllers();
|
services.AddControllers();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"HanyadikHetVan": {
|
||||||
|
"StartDate": "2021-02-01"
|
||||||
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
|
Loading…
Reference in New Issue
Block a user