commit f3ca76af464f0acd4ce3f434178794b918abab9d Author: Chika Date: Mon Oct 12 15:06:29 2020 +0300 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..add57be --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +bin/ +obj/ +/packages/ +riderModule.iml +/_ReSharper.Caches/ \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/codeStyles/codeStyleConfig.xml b/.idea/.idea.EvoCalculator.Core/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..7ad1bf1 --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml b/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml new file mode 100644 index 0000000..edccf9a --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/encodings.xml b/.idea/.idea.EvoCalculator.Core/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/indexLayout.xml b/.idea/.idea.EvoCalculator.Core/.idea/indexLayout.xml new file mode 100644 index 0000000..27ba142 --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/modules.xml b/.idea/.idea.EvoCalculator.Core/.idea/modules.xml new file mode 100644 index 0000000..85b8fbc --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/projectSettingsUpdater.xml b/.idea/.idea.EvoCalculator.Core/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..4bb9f4d --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/projectSettingsUpdater.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/vcs.xml b/.idea/.idea.EvoCalculator.Core/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml b/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml new file mode 100644 index 0000000..b2b7f3e --- /dev/null +++ b/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/EvoCalculator.Core.sln b/EvoCalculator.Core.sln new file mode 100644 index 0000000..4255010 --- /dev/null +++ b/EvoCalculator.Core.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvoCalculator.Core", "EvoCalculator.Core\EvoCalculator.Core.csproj", "{D1AA257A-BA2B-44FD-85E8-F4813B1A453C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1AA257A-BA2B-44FD-85E8-F4813B1A453C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1AA257A-BA2B-44FD-85E8-F4813B1A453C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1AA257A-BA2B-44FD-85E8-F4813B1A453C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1AA257A-BA2B-44FD-85E8-F4813B1A453C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/EvoCalculator.Core/Controllers/WeatherForecastController.cs b/EvoCalculator.Core/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..6605452 --- /dev/null +++ b/EvoCalculator.Core/Controllers/WeatherForecastController.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; + +namespace EvoCalculator.Core.Controllers +{ + [ApiController] + [Route("[controller]")] + public class WeatherForecastController : ControllerBase + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + private readonly ILogger _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet] + public IEnumerable Get() + { + var rng = new Random(); + return Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = DateTime.Now.AddDays(index), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }) + .ToArray(); + } + } +} \ No newline at end of file diff --git a/EvoCalculator.Core/EvoCalculator.Core.csproj b/EvoCalculator.Core/EvoCalculator.Core.csproj new file mode 100644 index 0000000..68ded6d --- /dev/null +++ b/EvoCalculator.Core/EvoCalculator.Core.csproj @@ -0,0 +1,8 @@ + + + + netcoreapp3.1 + + + + diff --git a/EvoCalculator.Core/Program.cs b/EvoCalculator.Core/Program.cs new file mode 100644 index 0000000..7ac157e --- /dev/null +++ b/EvoCalculator.Core/Program.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace EvoCalculator.Core +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }); + } +} \ No newline at end of file diff --git a/EvoCalculator.Core/Properties/launchSettings.json b/EvoCalculator.Core/Properties/launchSettings.json new file mode 100644 index 0000000..f1b5fbf --- /dev/null +++ b/EvoCalculator.Core/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:40662", + "sslPort": 44360 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "weatherforecast", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EvoCalculator.Core": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "weatherforecast", + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/EvoCalculator.Core/Startup.cs b/EvoCalculator.Core/Startup.cs new file mode 100644 index 0000000..d2cbbaa --- /dev/null +++ b/EvoCalculator.Core/Startup.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace EvoCalculator.Core +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllers(); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseHttpsRedirection(); + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); + } + } +} \ No newline at end of file diff --git a/EvoCalculator.Core/WeatherForecast.cs b/EvoCalculator.Core/WeatherForecast.cs new file mode 100644 index 0000000..0f83109 --- /dev/null +++ b/EvoCalculator.Core/WeatherForecast.cs @@ -0,0 +1,15 @@ +using System; + +namespace EvoCalculator.Core +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int) (TemperatureC / 0.5556); + + public string Summary { get; set; } + } +} \ No newline at end of file diff --git a/EvoCalculator.Core/appsettings.Development.json b/EvoCalculator.Core/appsettings.Development.json new file mode 100644 index 0000000..8983e0f --- /dev/null +++ b/EvoCalculator.Core/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/EvoCalculator.Core/appsettings.json b/EvoCalculator.Core/appsettings.json new file mode 100644 index 0000000..d9d9a9b --- /dev/null +++ b/EvoCalculator.Core/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +}