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
- C# - OmniSharp | |
- C# Extensions - JcHannon | |
- Bracket Pair Colorizer - CoenraadS | |
- Material Icon Theme - Philipp Kief | |
- Path Intellisense - Christian Kohler | |
- Nuget Package Manager - jmrog |
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
// Antes, para rodar o scaffolding, é necessário ter o package EntityFrameworkCore.SqlServer: | |
dotnet add package Microsoft.EntityFrameworkCore.SqlServer | |
// Use o comando abaixo para criar controller e views automaticamente para Pessoa: create, edit, details, delete e index | |
dotnet aspnet-codegenerator controller -name PessoasController --model HelloWorldAspNetCore.Models.Pessoa --dataContext HelloWorldAspNetCore.Context.HelloWorldAspNetCoreDbContext --relativ | |
eFolderPath Controllers --useDefaultLayout | |
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
// adicionar pacote necessario para Migrations no EF: Microsoft.EntityFramework.Design | |
dotnet add package Microsoft.EntityFrameworkCore.Design | |
// comando de adição de migration | |
dotnet ef migrations add MigracaoInicial | |
// depois de gerada a migration, para subir ao banco de dados, utilize o comando: | |
dotnet ef database update | |
// reverter a migration criada e voltar para alguma anterior (ex.: voltar para a MigracaoInicial) |
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
// Criar classe de domínio | |
1 - Criar dentro do folder Models (se existir) a model para o projeto | |
namespace HelloWorldAspNetCore.Models{ | |
public class Pessoa | |
{ | |
public int Id { get; set; } | |
public string Nome { get; set; } | |
public int Idade { get; set; } | |
public string Observacoes { 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
// Instalação do pacote | |
dotnet add package Microsoft.EntityFrameworkCore | |
// Ferramentas do EntityFramework | |
dotnet add package Microsoft.EntityFrameworkCore.Tools.Dotnet | |
// Dependencias Npgsql para operar com Postgres no EntityFramwork | |
dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL | |
// Dependencia do Npgsql para trabalhar com entity framework code-first |
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
// 1 - Baixar pacote de ferramentas | |
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Tools | |
dotnet restore | |
// 2 - Criar um elemento em ItemGroup do csproj referenciando a tool criada, na versão criada, exemplo: | |
<ItemGroup> | |
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.2" /> | |
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" /> | |
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.4" /> | |
</ItemGroup> |
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
LIFE CYCLE HOOKS | |
*Constructor | |
*ngOnChanges: Disparado sempre que algum property bind tiver sido modificado | |
*ngOnInit: Disparado quando o componente for iniciado | |
*ngDoCheck: Disparado a cada ciclo de verificação de mudança | |
> ngAfterContentInit: Disparado após o conteúdo do componente for iniciado | |
> ngAfterContentChecked: Disparado após o conteúdo do componente for checado | |
> ngAfterViewInit: Disparado após as views do componente forem iniciadas | |
> ngAfterViewChecked: Disparado após as views do componente forem checadas |
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
Build do Projeto | |
Build é o processo de converter o código fonte em algo entregável para uso. O build do projeto Angular será criado no diretório “dist”. | |
Build | |
Para fazer build do projeto execute o comando: | |
$ ng build | |
Build de Produção | |
Build otimizado para ser utilizado pelo usuário final. | |
Execute o comando: |
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
Análise da Qualidade do Código | |
Execute o comando: | |
$ ng lint | |
Testes Unitários | |
Execute o comando: | |
$ ng test | |
Testes End to End | |
Execute o comando: |