Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
fMATSINHE committed Jan 4, 2020
1 parent abcc6ca commit 5840862
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Helloword_core.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29613.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Helloword_core", "Helloword_core\Helloword_core.csproj", "{7F3E676F-BAEB-4B9A-AB3E-9233000E768C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F3E676F-BAEB-4B9A-AB3E-9233000E768C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F3E676F-BAEB-4B9A-AB3E-9233000E768C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F3E676F-BAEB-4B9A-AB3E-9233000E768C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F3E676F-BAEB-4B9A-AB3E-9233000E768C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {682729E0-0E3C-47D8-9D5F-EB4386640B22}
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions Helloword_core/Hello.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Helloword_core
{
public class Hello : IHello
{
public Hello()
{
//throw new Exception();
}

string IHello.SayHello()
{
return "Hello fromn class";
}
}
}
16 changes: 16 additions & 0 deletions Helloword_core/Helloword_core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions Helloword_core/IHello.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Helloword_core
{
public interface IHello
{
string SayHello();
}
}

24 changes: 24 additions & 0 deletions Helloword_core/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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 Helloword_core
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
27 changes: 27 additions & 0 deletions Helloword_core/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49675",
"sslPort": 44324
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Helloword_core": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
37 changes: 37 additions & 0 deletions Helloword_core/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace Helloword_core
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IHello, Hello>();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IHello novo)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}



app.Run(async (context) =>
{
await context.Response.WriteAsync(novo.SayHello());
});
}
}
}

0 comments on commit 5840862

Please sign in to comment.