internal void SaveFavorite(as_favorites favorite) { try { db.SaveItem(favorite); } catch (Exception ex) { RDL.Debug.LogError(ex); } }
internal int AddFavorites(as_favorites favorite) { try { return(db.SaveItem(favorite)); } catch (Exception ex) { RDL.Debug.LogError(ex); } return(-1); }
public int SaveItem(as_favorites favorite) { if (favorite.id == 0) { db.as_favorites.Add(favorite); db.SaveChanges(); } else { try { db.Entry(favorite).State = EntityState.Modified; db.SaveChanges(); } catch (OptimisticConcurrencyException ex) { RDL.Debug.LogError(ex); } } return(favorite.id); }
public as_favorites GetItem(int id) { as_favorites res = db.as_favorites.FirstOrDefault(x => x.id == id); return(res); }