private preferencia getSeriePref() { preferencia pref = (from p in DBManager.Context.preferencias where p.nombre == "copia_serie" select p).FirstOrDefault(); return(pref); }
public async Task <preferencia> FindContentChanged() { preferencia result = await(from r in DBManager.Context.preferencias where r.nombre == CONTENT_CHANGED_KEY select r).FirstOrDefaultAsync(); return(result); }
public void SetContentUnchangedRegistry() { preferencia pref = (from r in DBManager.Context.preferencias where r.nombre == CONTENT_CHANGED_KEY select r).FirstOrDefault(); if (pref != null) { pref.valor_int = 0; Update(pref); } }
public int NextSerie() { preferencia pref = this.getSeriePref(); if (pref != null && pref.valor_int != null) { return((int)pref.valor_int); } else { return(-1); } }
public copia Add(copia entity) { try { copia c = DBManager.Context.copias.Add(entity); DBManager.Context.SaveChanges(); if (c != null) { preferencia pref = this.getSeriePref(); pref.valor_int++; DBManager.Context.Entry(pref).State = EntityState.Modified; DBManager.Context.SaveChanges(); } return(c); } catch (System.Exception e) { throw e; } }
public void Update(preferencia entity) { DBManager.Context.Entry(entity).State = EntityState.Modified; DBManager.Context.SaveChanges(); }