public bool UpdateInstrument(InstrumentEntity instrument)
        {
            /*var instrumentUpdate = dbContext.Instruments.FirstOrDefault(i => i.Id == instrument.Id);
             * instrumentUpdate.Name = instrument.Name ?? instrumentUpdate.Name;
             * instrumentUpdate.Description = instrument.Description ?? instrumentUpdate.Description;
             * instrumentUpdate.Price = instrument.Price ?? instrument.Price;*/

            dbContext.Entry(instrument.Store).State = EntityState.Unchanged;
            dbContext.Instruments.Update(instrument);
            return(true);
        }
Ejemplo n.º 2
0
        public static Instrument MapToInstrumentDto(this InstrumentEntity entity)
        {
            var dto = new Instrument
            {
                InstrumentId   = entity.InstrumentId,
                InstrumentType = entity.InstrumentType,
                Name           = entity.Name,
                Symbol         = entity.Symbol
            };

            return(dto);
        }
Ejemplo n.º 3
0
        public static InstrumentEntity MapToInstrumentEntity(IDataReader reader)
        {
            var instrument = new InstrumentEntity()
            {
                InstrumentId   = reader.GetValueOrDefault <int>("instrumentId"),
                InstrumentType = reader.GetValueOrDefault <string>("instrumentType"),
                Name           = reader.GetValueOrDefault <string>("name"),
                Symbol         = reader.GetValueOrDefault <string>("symbol")
            };

            return(instrument);
        }
 public void Update(InstrumentEntity instrumentEntity)
 {
     _instrumentRepository.Update(instrumentEntity);
 }
 public int Insert(InstrumentEntity instrumentEntity)
 {
     return(_instrumentRepository.Add(instrumentEntity));
 }
        public bool Delete(InstrumentEntity instrumentEntity)
        {
            _instrumentRepository.Delete(instrumentEntity);

            return(true);
        }
 public void CreateInstrument(InstrumentEntity newInstrument)
 {
     dbContext.Entry(newInstrument.Store).State = EntityState.Unchanged;
     dbContext.Instruments.Add(newInstrument);
 }
Ejemplo n.º 8
0
 public bool DelInstrument(InstrumentEntity entity)
 {
     return(instrument.DelInstrument(entity));
 }
Ejemplo n.º 9
0
 public void SaveInstrument(string Id, InstrumentEntity entity)
 {
     instrument.SaveInstrument(Id, entity);
 }