Skip to content

Commit

Permalink
K&R braces and 4-space indents
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesseanwright committed Oct 30, 2017
1 parent ad4b092 commit 9bd2c97
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 109 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.cs]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,5 @@ __pycache__/

# OpenCover UI analysis results
OpenCover/

.vscode
44 changes: 0 additions & 44 deletions Controllers/ValuesController.cs

This file was deleted.

2 changes: 2 additions & 0 deletions GitHubAutoresponder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="xunit" Version="2.3.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down
47 changes: 22 additions & 25 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
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 GitHubAutoresponder
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
}
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 GitHubAutoresponder {
public class Program {
public static void Main(string[] args) {
BuildWebHost(args).Run();
}

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
}
74 changes: 34 additions & 40 deletions Startup.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
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 GitHubAutoresponder
{
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();
}
}
}
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 GitHubAutoresponder {
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();
}
}
}
5 changes: 5 additions & 0 deletions Webhook/Payload.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace GitHubAutoresponder.Webhook {
class Payload {

}
}
35 changes: 35 additions & 0 deletions Webhook/WebhookController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace GitHubAutoresponder.Webhook {
[Route("api/[controller]")]
public class WebhookController : Controller {
[HttpGet]
public IEnumerable<string> Get() {
return new string[] { "value1", "value2" };
}

[HttpGet("{id}")]
public string Get(int id) {
return "value";
}

[HttpPost]
public void Post([FromBody]string value) {

}

[HttpPut("{id}")]
public void Put(int id, [FromBody]string value) {

}

[HttpDelete("{id}")]
public void Delete(int id) {

}
}
}

0 comments on commit 9bd2c97

Please sign in to comment.