Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.SqlClient;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.SqlServer;
namespace LazyLoading
{
public class Contexto : DbContext
{
public DbSet<Customers> Customers {get; set;}
public DbSet<Orders> Orders {get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var conexao = new SqlConnectionStringBuilder()
{
DataSource = "(local)",
InitialCatalog = "NorthWind",
IntegratedSecurity = true
};
optionsBuilder.UseSqlServer(conexao.ConnectionString);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment