Skip to content

Instantly share code, notes, and snippets.

View juanluelguerre's full-sized avatar
:octocat:
Developing...

Juan Luis Guerrero Minero juanluelguerre

:octocat:
Developing...
View GitHub Profile
"Serilog": {
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "Console",
"Args": {
public ProjectsController(
IProjectService service,
ILogger<ProjectsController> logger)
{
_service = service;
_logger = logger;
}
[HttpGet]
public async Task<ActionResult<IEnumerable<ProjectModel>>> GetAll()
public static class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseIISIntegration()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.ConfigureAppConfiguration((context, configBuilder) =>
@juanluelguerre
juanluelguerre / Startup.cs
Last active June 1, 2019 12:59
Snippet to Use Swagger Configure(IApplicationBuilder app, IHostingEnvironment env)
app.UseSwagger()
.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Taskin V1");
});
@juanluelguerre
juanluelguerre / Startup.cs
Created April 15, 2018 11:36
Snippet to Add Swagger to ConfigureServices(IServiceCollection services)
// Add Swagger
services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1",
new Info
{
Version = "v1",
Title = "Taskin API",
Description = "API to expose Taskin logic",
TermsOfService = "https://github.com/juanluelguerre/Taskin/blob/master/LICENSE"
@juanluelguerre
juanluelguerre / Startup.cs
Last active April 15, 2018 11:32
Using Swashbuckle with NetCORE to get standard OpenAPI
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Swashbuckle.AspNetCore.Swagger;
namespace ElGuerre.Taskin.Api
{
public class Startup