Esempio n. 1
0
        public void Process(DataCollectorVillageChanged @event)
        {
            var dataCollector = _dataCollectors.GetById(@event.DataCollectorId);

            dataCollector.Village = @event.Village;
            _dataCollectors.Update(dataCollector);
        }
Esempio n. 2
0
        public void Process(DataCollectorVillageChanged @event, EventSourceId dataCollectorId)
        {
            var dataCollector = _dataCollectors.GetById(dataCollectorId.Value);

            dataCollector.Village = @event.Village;

            _dataCollectors.Update(dataCollector);
        }
Esempio n. 3
0
        public void Process(DataCollectorVillageChanged @event, EventSourceId dataCollectorId)
        {
            var village = _repositoryForVillage.Query.FirstOrDefault(_ => _.Name == @event.Village);

            if (village == null)
            {
                var dataCollector = _dataCollectors.GetById(dataCollectorId);
                var district      = _repositoryForDistrict.Query.FirstOrDefault(_ => _.Name == dataCollector.District);
                _repositoryForVillage.Insert(new Village()
                {
                    Id         = Guid.NewGuid(),
                    Name       = @event.Village,
                    DistrictId = district.Id
                });
            }
        }
 public void Process(DataCollectorVillageChanged @event)
 {
     var updateRes = _dataCollectors.Update(d => d.Id == @event.DataCollectorId,
                                            Builders <DataCollector> .Update.Set(d => d.Village, @event.Village ?? "Unknown"));
 }
Esempio n. 5
0
 public void Process(DataCollectorVillageChanged @event)
 {
     _dataCollectors.Update(d => d.Id == (DataCollectorId)@event.DataCollectorId,
                            Builders <DataCollector> .Update.Set(d => d.Village, @event.Village));
 }
Esempio n. 6
0
 public void Process(DataCollectorVillageChanged @event)
 {
     var res = _dataCollectors.UpdateOne(
         Builders <DataCollector> .Filter.Where(d => d.DataCollectorId == @event.DataCollectorId),
         Builders <DataCollector> .Update.Set(d => d.Village, @event.Village));
 }
Esempio n. 7
0
 public void Process(DataCollectorVillageChanged @event)
 {
     _dataCollectors.Update(Builders <DataCollector> .Filter.Where(d => d.Id == @event.DataCollectorId),
                            Builders <DataCollector> .Update.Set(d => d.Village, @event.Village ?? "Unknown"));
 }