Пример #1
0
        static void IncluirUsuarios(VotadorContext context)
        {
            context.AddRange(new Usuario
            {
                Nome  = "Rafael",
                Email = "*****@*****.**",
                Ativo = true,
                Senha = "123",
            }, new Usuario
            {
                Nome  = "Laura",
                Email = "*****@*****.**",
                Ativo = true,
                Senha = "123",
            }, new Usuario
            {
                Nome  = "Janine",
                Email = "*****@*****.**",
                Ativo = true,
                Senha = "123",
            });

            context.SaveChanges();
        }
Пример #2
0
 public virtual void Atualizar(T model)
 {
     context.Entry(model).State = EntityState.Modified;
     context.SaveChanges();
 }