This file contains hidden or 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
// 2 classes de métodos de extensão: StringExtensions e ModelBuilderExtensions | |
// 1 - String Extensions | |
using System.Text.RegularExpressions; | |
using Microsoft.EntityFrameworkCore; | |
namespace HelloWorldAspNetCore.Extensions | |
{ | |
public static class StringExtensions | |
{ |
This file contains hidden or 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
{ | |
"3166-1": [ | |
{ | |
"alpha_2": "AW", | |
"alpha_3": "ABW", | |
"name": "Aruba", | |
"numeric": "533" | |
}, | |
{ | |
"alpha_2": "AF", |
This file contains hidden or 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
#!/bin/bash | |
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment | |
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen | |
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf | |
sudo locale-gen en_US.UTF-8 |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
This file contains hidden or 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
# Outside of shell | |
# - Create project directory | |
# - git init | |
# - open in vs code >code . | |
# - Using remote container extensions create new development container | |
# - Using dotnet core 3.1 or later container template | |
# - Re-open in container and run the script below | |
dotnet new sln | |
dotnet new xunit -n Application.IntegrationTests -o ./tests/Application.IntegrationTests |
This file contains hidden or 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
/* | |
ORM (Object-Relational Mapping) allows us to have a framework | |
for storing objects within relational databases and translating between | |
DATABASE-CODE communication. | |
What is ORM? | |
1. Object relational mapping is a technique for storing, | |
retrieving, updating and deleting (CRUD) from | |
an object-oriented program in a relational database. | |
2. Utilization of "data layer" to manage translation between the OO and relational |
This file contains hidden or 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
#!csharp | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.DotNet.Interactive; | |
using Microsoft.DotNet.Interactive.Formatting; | |
using static Microsoft.DotNet.Interactive.Formatting.PocketViewTags; | |
void downloadAndShowImages(params string[] urls) { | |
display(span(urls.Select(url => |
This file contains hidden or 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
#!csharp | |
#r "nuget:Microsoft.Extensions.Configuration" | |
#r "nuget:Microsoft.Extensions.Configuration.Json" | |
#r "nuget:Dapper" | |
#r "nuget:Dapper.Contrib" | |
#r "nuget:System.Data.SqlClient" | |
#r "System.IO" | |
#!csharp |
This file contains hidden or 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
#!markdown | |
Records in C# | |
#!csharp | |
public class Course | |
{ | |
public string Name {get; set;} | |
public string Author {get; set;} |
This file contains hidden or 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
#!markdown | |
# Using SQLite in Notebook | |
Install ExtensionLab NuGet package | |
#!csharp | |
#r "nuget: System.Data.SQLite, *-*" | |
#r "nuget: Microsoft.DotNet.Interactive.ExtensionLab, *-*" |