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); }
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); }
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); }
public bool DelInstrument(InstrumentEntity entity) { return(instrument.DelInstrument(entity)); }
public void SaveInstrument(string Id, InstrumentEntity entity) { instrument.SaveInstrument(Id, entity); }