This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Firebase Hosting on merge | |
'on': | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyAutoMapperProfile : Profile | |
{ | |
public MyAutoMapperProfile() | |
{ | |
CreateMap<Foo, FooDto>(); | |
// Use CreateMap... Etc.. here (Profile methods are the same as configuration methods) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Serilog": { | |
"Using": [ "Serilog.Sinks.Console" ], | |
"MinimumLevel": "Information", | |
"WriteTo": [ | |
{ | |
"Name": "Console" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void CreateLogger(IConfigurationRoot configuration) | |
{ | |
Log.Logger = new LoggerConfiguration() | |
.MinimumLevel.Debug() | |
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) | |
.Enrich.FromLogContext() | |
.ReadFrom.Configuration(configuration) | |
.CreateLogger(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if DEBUG | |
var builder = new ConfigurationBuilder() | |
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory) | |
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) | |
.AddEnvironmentVariables(); | |
#else | |
var builder = new ConfigurationBuilder() | |
.SetBasePath(AppDomain.CurrentDomain.BaseDirectory) | |
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ContainerBuilder ConfigureServices(IServiceCollection serviceCollection) | |
{ | |
CreateLogger(Configuration); | |
serviceCollection.AddAutofac(); | |
serviceCollection.AddOptions(); | |
var builder = new ContainerBuilder(); | |
builder.Populate(serviceCollection); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- Models | |
|---- Foo.cs | |
---- Modules | |
|---- ConsoleModules.cs | |
---- AutoMapper | |
|---- MyAutoMapperProfile.cs | |
---- appsettings.json | |
---- Program.cs | |
---- Startup.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet new core-console-autofac -n MyFirstConsole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet new --install Superwalnut.NetCoreConsoleTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Once that is completed, it creates workflows yml file for github actions. | |
NewerOlder