public void Handle(NoteTextChanged evnt)
        {
            using (var context = new ReadModelContainer())
            {
                var itemToUpdate = context.NoteItemSet.Single(item => item.Id == evnt.NoteId);
                itemToUpdate.Text = evnt.NewText;

                context.SaveChanges();
            }
        }
Beispiel #2
0
 public void Handle(NoteTextChanged evnt)
 {
     if (evnt.SummaryId.Equals(Guid.Empty))
     {
         AggregateRoot aggregateRoot = new NoteDailySummary(Guid.NewGuid(), System.DateTime.UtcNow, 0, 1);
         UnitOfWork.Current.RegisterDirtyInstance(aggregateRoot);
     }
     else
     {
         var noteDailySummary = UnitOfWork.Current.GetById(typeof(NoteDailySummary), evnt.SummaryId) as NoteDailySummary;
         noteDailySummary.UpdateDailySummary(0, 1);
         UnitOfWork.Current.RegisterDirtyInstance(noteDailySummary);
     }
 }
        public void Handle(NoteTextChanged evnt)
        {
            using (var context = new ReadModelContainer())
            {
                var date          = evnt.EventTimeStamp.Date;
                var totalsForDate = context.TotalsPerDayItemSet.SingleOrDefault(i => i.Date == date);

                if (totalsForDate == null)
                {
                    totalsForDate = new TotalsPerDayItem {
                        Date = date
                    };
                    context.TotalsPerDayItemSet.AddObject(totalsForDate);
                }

                totalsForDate.EditCount++;

                context.SaveChanges();
            }
        }
Beispiel #4
0
 // Event handler for the NoteTextChanged event. This method
 // is automaticly wired as event handler based on convension.
 protected void OnNoteTextChanged(NoteTextChanged e)
 {
     _text = e.NewText;
 }
Beispiel #5
0
 protected virtual void OnNoteTextChanged(NoteEventArgs e)
 {
     NoteTextChanged?.Invoke(this, e);
 }
Beispiel #6
0
 protected void OnNoteTextChanged(NoteTextChanged e)
 {
     this.text = e.Text;
 }