public NeedForBlood GetById(int id) { NeedForBlood result = null; using (AppDBContext dbContext = new AppDBContext(_config)) { result = dbContext.NeedForBlood.Where(a => a.Id == id).AsNoTracking().SingleOrDefault(); } return(result); }
public int Update(NeedForBlood record) { int result = 0; using (AppDBContext dbContext = new AppDBContext(_config)) { dbContext.Entry(record).State = EntityState.Modified; result = dbContext.SaveChanges(); } return(result); }