Ejemplo n.º 1
0
        public Task <List <BD_Receive> > GetReceivesAsync(BD_Instrument instrument)
        {
            var query = from rein in _receiveInstrumentRepository.GetAll()
                        join re in _receiveRepository.GetAll() on rein.Receive_ID equals re.Id
                        where rein.Instrument_ID == instrument.Id
                        select re;

            return(Task.FromResult(query.ToList()));
        }
Ejemplo n.º 2
0
        public async Task AddToReceiveAsync(BD_Instrument instrument, BD_Receive receive)
        {
            var currentReceives = await GetReceivesAsync(instrument);

            if (currentReceives.Any(cre => cre.Id == receive.Id))
            {
                return;
            }

            await _receiveInstrumentRepository.InsertAsync(new BD_ReceiveInstrument(instrument.Id, receive.Id));
        }
Ejemplo n.º 3
0
 public async Task RemoveFromReceiveAsync(BD_Instrument instrument, BD_Receive receive)
 {
     await _receiveInstrumentRepository.DeleteAsync(rein => rein.Instrument_ID == instrument.Id && rein.Receive_ID == receive.Id);
 }