public static void Delete(int identifier)
 {
     using (TradeProAssistantContext context = new TradeProAssistantContext())
     {
         try
         {
             FutureContract futurecontract = context.FutureContracts.Find(identifier);
             context.Entry(futurecontract).State = EntityState.Deleted;
             context.SaveChanges();
         }
         catch { }
     }
 }
        public static int Save(FutureContract futurecontract)
        {
            using (TradeProAssistantContext context = new TradeProAssistantContext())
            {
                context.Entry(futurecontract).State = futurecontract.IsNew ?
                                                      EntityState.Added :
                                                      EntityState.Modified;

                context.SaveChanges();

                return(futurecontract.Identifier);
            }
        }
 public void AddSelfLink(FutureContract contract)
 {
     contract.AddLink(GetSelfLink(contract.ContractID));
 }
 private void AddAllFutureContractsLink(FutureContract contract)
 {
     contract.AddLink(GetAllFutureContractsLink());
 }
 public void AddLinks(FutureContract contract)
 {
     AddSelfLink(contract);
     AddAllFutureContractsLink(contract);
 }
Beispiel #6
0
        public FutureContract GetById(int id)
        {
            FutureContract contract = _futureContractByIdInquiry.GetFutureContract(id);

            return(contract);
        }
 public static void Delete(FutureContract futurecontract)
 {
     Delete(futurecontract.Identifier);
 }