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
add-migration-linux: | |
@read -p "Nome da migration (ex: TipoTabelaMotivo) : " table \ | |
&& dotnet ef --startup-project ../Sln.projetoBase migrations add $${table} | |
remove-migration-linux: | |
dotnet ef --startup-project ../Sln.projetoBase migrations remove | |
update-database: | |
@echo "Você revisou a migration antes de enviar?" | |
@read -p "[Enter para confimar || CTRL + C para cancelar]" reponse; |
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
import axios from 'axios' | |
import { getToken, logout } from './auth' | |
import config from '../Constants' | |
export const hub = config.url.Hub | |
const api = axios.create({ | |
baseURL: config.url.route, | |
}) |
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
Você sabe como recuperar uma branch que você apagou local e tinha código que não podia perder no GIT? | |
quando você dá 𝗴𝗶𝘁 𝗿𝗲𝗳𝗹𝗼𝗴 𝘀𝗵𝗼𝘄, vai mostrar o histórico com últimos commits, lá você vai achar o código SHA do seu commit, ou caso o terminal esteja aberto e o comando de deletar a branch ainda esteja no histórico do lado ele vai ter o código SHA | |
Depois basta copiar esse código SHA | |
e dar: | |
𝗴𝗶𝘁 𝗯𝗿𝗮𝗻𝗰𝗵 𝗯𝗿𝗮𝗻𝗰𝗵𝗡𝗮𝗺𝗲 <𝗦𝗛𝗔𝟭> |
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
using Domain.Models; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.Extensions.Configuration; | |
namespace Infrastructure.Database.Context | |
{ | |
public class MssqlContext : DbContext | |
{ | |
public MssqlContext() |
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
using Microsoft.EntityFrameworkCore; | |
using System.ComponentModel.DataAnnotations.Schema; | |
namespace Domain.Models | |
{ | |
[Keyless] | |
[Table ("NOME_VIEW", Schema ="SCHEMA")] | |
public class ProgramacaoDoGasView | |
{ |
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 void SaveChangesParallel(List<objeto> objetos) | |
{ | |
var saveList = new List<List<objeto>>(); | |
var count = 0; | |
while (count < objetos.Count) | |
{ | |
var partialSaves = objetos.Skip(count).Take(250).ToList(); | |
count += partialSaves.Count; | |
saveList.Add(partialSaves); | |
} |
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
try | |
{ | |
using var dbContext = new Context(); | |
Console.WriteLine($"Connected {dbContext.Database.CanConnectAsync().Result}"); | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine($"Error {e.Message}"); | |
} |
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<TargetFramework>net8.0</TargetFramework> | |
<Nullable>enable</Nullable> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<GenerateDocumentationFile>true</GenerateDocumentationFile> | |
<NoWarn>$(NoWarn);1591</NoWarn> | |
</PropertyGroup> |
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
.UseNpgsql(...) | |
.UseSnakeCaseNamingConvention(); |
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
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
## | |
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore | |
# User-specific files | |
*.rsuser | |
*.suo | |
*.user | |
*.userosscache |
NewerOlder