public void RouteMasterData(MasterBaseDTO dTO, MasterDataDTOSaveCollective type)
        {

            
            var queueItem = new OutGoingMasterDataQueueItemLocal
                                {
                                    MasterId = dTO.MasterId,
                                    Type = type,
                                    IsSent = false,
                                    DateSent = DateTime.Now,
                                    JsonDTO = JsonConvert.SerializeObject(dTO, new IsoDateTimeConverter())
                                };
            _outGoingRepository.Add(queueItem);

        }
        public void Add(OutGoingMasterDataQueueItemLocal itemToAdd)
        {
                 var existing = GetByIOD(itemToAdd.Id);
            if (existing == null)
            {
                existing = new OutGoingMasterDataQueueItemLocal();
                _ctx.OutGoingMasterDataQueueItemLocals.Add(existing);
            }
            existing.Id = itemToAdd.Id;
            existing.Type = itemToAdd.Type;
            existing.JsonDTO = itemToAdd.JsonDTO;
            existing.MasterId = itemToAdd.MasterId;
            existing.IsSent = itemToAdd.IsSent;
            existing.DateSent = DateTime.Now;

           _ctx.SaveChanges();
           
        }