public static void Delete(int identifier) { using (TradeProAssistantContext context = new TradeProAssistantContext()) { try { DayCandlestick daycandlestick = context.DayCandlesticks.Find(identifier); context.Entry(daycandlestick).State = EntityState.Deleted; context.SaveChanges(); } catch { } } }
public static int Save(DayCandlestick daycandlestick) { using (TradeProAssistantContext context = new TradeProAssistantContext()) { context.Entry(daycandlestick).State = daycandlestick.IsNew ? EntityState.Added : EntityState.Modified; context.SaveChanges(); return(daycandlestick.Identifier); } }
public static void Delete(DayCandlestick daycandlestick) { Delete(daycandlestick.Identifier); }