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
Product p1 = db.Product.Include(x => x.Details) | |
.FirstOrDefault(x => x.Id == 1); |
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
SELECT TOP(1) [x].[Id], [x].[Description] | |
FROM [Products] AS [x] | |
WHERE [x].[Id] = 1 |
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
Product p0 = db.Product.FirstOrDefault(x => x.Id == 1); |
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
public class ProductDetailsMap : IEntityTypeConfiguration<ProductDetails> | |
{ | |
public void Configure(EntityTypeBuilder<ProductDetails> builder) | |
{ | |
builder.ToTable("Products"); | |
builder.HasKey(x => x.Id); | |
builder.Property(x => x.Amount) | |
.IsRequired(); |
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
public class ProductMap : IEntityTypeConfiguration<Product> | |
{ | |
public void Configure(EntityTypeBuilder<Product> builder) | |
{ | |
builder.ToTable("Products"); | |
builder.HasKey(x => x.Id); | |
builder.Property(x => x.Id) | |
.IsRequired() | |
.UseSqlServerIdentityColumn(); |
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
public class Product | |
{ | |
public int Id { get; set; } | |
public string Description { get; set; } | |
public ProductDetails Details { get; set; } | |
} | |
public class ProductDetails | |
{ | |
public int Id { 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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore; | |
namespace MyApp.Api |
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
jQuery.validator.addMethod("cnpj", function (cnpj, element) { | |
cnpj = jQuery.trim(cnpj); | |
// DEIXA APENAS OS NÚMEROS | |
cnpj = cnpj.replace('/', ''); | |
cnpj = cnpj.replace('.', ''); | |
cnpj = cnpj.replace('.', ''); | |
cnpj = cnpj.replace('-', ''); | |
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais; |
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
/* | |
verifica_cpf_cnpj | |
Verifica se é CPF ou CNPJ | |
@see http://www.tutsup.com/ | |
*/ | |
function verifica_cpf_cnpj ( valor ) { | |
// Garante que o valor é uma string |