private void Init(ContextoAPI context) { var servPessoa = new ServicoDePessoa <ContextoAPI>(context); var resposta = servPessoa.CadastraEntidade(new PessoaRequest() { Ativo = true, CPF = "96179162077", DataNascimento = DateTime.Now, Nome = "root", UF = "GO" }); }
public static ContextoAPI DadosMemoria() { var options = new DbContextOptionsBuilder <ContextoAPI>() .UseInMemoryDatabase(Guid .NewGuid().ToString()).Options; var contexto = new ContextoAPI(options); contexto.Pessoas.AddRange(new List <Pessoa>() { //pt-BR new Pessoa() { ID = Guid.NewGuid(), Pais = "pt-BR", Nome = "Junior Porfirio", Excluido = false, WebSite = @"https://medium.com/@juniorporfirio" }, new Pessoa() { ID = Guid.NewGuid(), Pais = "pt-BR", Nome = "Renato Groffe", Excluido = false, WebSite = @"https://medium.com/@renato.groffe" }, new Pessoa() { ID = Guid.NewGuid(), Pais = "pt-BR", Nome = "Rodolfo Fadino", Excluido = false, WebSite = @"https://rodolfofadino.com.br/" }, //en-US new Pessoa() { ID = Guid.NewGuid(), Pais = "en-US", Nome = "Scott Hanselman", Excluido = false, WebSite = @"https://www.hanselman.com/" }, new Pessoa() { ID = Guid.NewGuid(), Pais = "en-US", Nome = "Greg Shackles", Excluido = false, WebSite = @"https://gregshackles.com/" } }); contexto.SaveChanges(); return(contexto); }
public PessoaController(ContextoAPI contexto) { _contexto = contexto; }
public PessoaController(ContextoAPI context) { ServicoDePessoa = new ServicoDePessoa <ContextoAPI>(context); ServicoDeSessao = new ServicoDeSessao <ContextoAPI>(context); }
public LoginController(ContextoAPI context) { ServicoDeSessao = new ServicoDeSessao <ContextoAPI>(context); }