Exemple #1
0
 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 { }
     }
 }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
 public static void Delete(DayCandlestick daycandlestick)
 {
     Delete(daycandlestick.Identifier);
 }