Skip to content

Instantly share code, notes, and snippets.

View Guifgr's full-sized avatar
:shipit:
LoFi and Coffe

Guilherme FGR Guifgr

:shipit:
LoFi and Coffe
View GitHub Profile
@offpepe
offpepe / ExampleToInjectClass.cs
Created September 6, 2022 17:48
Configure appsettings into object using microsoft.extensions.dependencyInjection
using Microsoft.Extensions.Options;
using Offpepe.Gists.Configurations;
namespace Offpepe.Gists.Business;
// Injecting config
public class ExampleClassToInject {
private readonly ConfigObject _configObject;
public ExampleClassToInject(IOptions<ConfigObject> configObject) {
_configObject = configObject.Value;
@yanandrey
yanandrey / SwaggerApi.csproj
Last active February 24, 2022 22:19
Swagger Configuration
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>