// GET: Cuentas/Create public IActionResult Create() { ViewData["idCampana"] = new SelectList(_context.Set <Campana>(), "idCampana", "nombre"); ViewData["idContacto"] = new SelectList(_context.Contacto, "idContacto", "email"); ViewData["idSegmento"] = new SelectList(_context.Segmento, "idSegmento", "nombre"); return(View()); }
public Task <Usuario> FindByNameAsync(string userName) { var id = (from c in db.Set <Usuario>() where c.UserName.Equals(userName) select c.Id).ToList(); var aux = (id.Count > 0) ? id[0] : 0; var usuario = db.Set <Usuario>().Find(aux); return(Task.FromResult(usuario)); }
public void Adicionar(T obj) { contexto.Set <T>().Add(obj); contexto.SaveChanges(); }
// GET: TipoEventos/Create public IActionResult Create() { ViewData["idMaestroEvento"] = new SelectList(_context.Set <MaestroEvento>(), "idMaestroEvento", "nombre"); return(View()); }
public void Add <T>(T entity) where T : class { Context.Set <T>().Add(entity); Context.SaveChanges(); }
public IQueryable <Ent> Filtrar(Expression <Func <Ent, bool> > predicate) => Db.Set <Ent>().Where(predicate);
public RepositorioBase(DbContexto db) { Db = db; Set = Db.Set <Ent>(); }
public void add(TEntity obj) { Db.Set <TEntity>().Add(obj); Db.SaveChanges(); }
public async Task <IEnumerable <T> > BuscarTodosAsync() { return(await _dbContexto.Set <T>().AsNoTracking().ToListAsync()); }
public int Create(T entity) { _db.Set<T>().Add(entity); return _db.SaveChanges(); }
public bool IdExist(Guid id) => db.Set <TEntity>().Any(p => p.Id.Equals(id));