Initial commit of .NET Core bot versioin

This commit is contained in:
Mohamed Saif 2018-02-10 09:32:24 +02:00
Родитель df3f058f4b
Коммит ff31438e50
7 изменённых файлов: 181 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace ContosoMaintenance.Bot.WebApp.Core.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// GET api/values
[HttpGet]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[HttpGet("{id}")]
public string Get(int id)
{
return "value";
}
// POST api/values
[HttpPost]
public void Post([FromBody]string value)
{
}
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
}
// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace ContosoMaintenance.Bot.WebApp.Core
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
}

Просмотреть файл

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace ContosoMaintenance.Bot.WebApp.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.AddMvc();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
}
}
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}

Просмотреть файл

@ -0,0 +1,15 @@
{
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning"
}
}
}
}

Просмотреть файл

@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2026
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebAPI", "WebAPI", "{9F0FD859-1134-4C77-99E5-83703A2DE5A2}"
EndProject
@ -30,6 +30,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BotWebApp", "BotWebApp", "{
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoMaintenance.Bot.WebApp", "Backend\BotBackend\ContosoMaintenance.Bot.WebApp.csproj", "{9C7E3A46-B60F-4052-9A21-DC8D1A942216}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContosoMaintenance.Bot.WebApp.Core", "Backend\BotBackend-Core\ContosoMaintenance.Bot.WebApp.Core\ContosoMaintenance.Bot.WebApp.Core.csproj", "{C517885A-08F2-42E7-B9D6-E29D76C3C05F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -204,6 +206,30 @@ Global
{9C7E3A46-B60F-4052-9A21-DC8D1A942216}.ReleaseBackend|iPhone.Build.0 = Release|Any CPU
{9C7E3A46-B60F-4052-9A21-DC8D1A942216}.ReleaseBackend|iPhoneSimulator.ActiveCfg = Release|Any CPU
{9C7E3A46-B60F-4052-9A21-DC8D1A942216}.ReleaseBackend|iPhoneSimulator.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|iPhone.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|Any CPU.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|Any CPU.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|iPhone.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|iPhone.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.DebugBackend|iPhoneSimulator.Build.0 = Debug|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|Any CPU.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|iPhone.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|iPhone.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|Any CPU.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|Any CPU.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|iPhone.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|iPhone.Build.0 = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C517885A-08F2-42E7-B9D6-E29D76C3C05F}.ReleaseBackend|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -219,6 +245,7 @@ Global
{903A6DB8-26AB-466D-8ACD-7A7A2DE9A67F} = {A5E6EEE2-C985-4C48-A6FD-BD95BFAA25EA}
{B6E498F2-60A4-44BE-B4D9-D8D2F953066D} = {F9802EBB-7857-4380-B1AD-F4CDE60F43F2}
{9C7E3A46-B60F-4052-9A21-DC8D1A942216} = {140A5FB1-CD49-4998-8196-74EF067452B3}
{C517885A-08F2-42E7-B9D6-E29D76C3C05F} = {140A5FB1-CD49-4998-8196-74EF067452B3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {60FF5FF1-44FA-4082-8169-95F16F23BE13}