public static bool AddConsumed(Consumed consumed) { lock (dcc) { try { dcc.Consumeds.Add(consumed); dcc.SaveChanges(); return true; } catch (Exception) { } return false; } }
private static Favorite GetFavorite(Consumed consumed) { return (from favorite in dcc.Favorites where favorite.FavoriteId == consumed.FavoriteId select favorite).First(); }
public WcfConsumed(Consumed consumed) { this.ConsumeTime = consumed.ConsumeTime; this.Favorite = new WcfFavorite(consumed.Favorite); }