상속: Ncqrs.Eventing.Sourcing.SourcedEvent, IIdentifiable
예제 #1
0
        public void SetProperty(Guid userID, string name, string value)
        {
            var e = new UserPropertySetEvent(Guid.NewGuid(), Guid.Empty, this.Version + 1, DateTime.UtcNow)
            {
                UserID = userID,
                Name = name,
                Value = value,
                TimeStamp = DateTime.UtcNow
            };

            ApplyEvent(e);
        }
예제 #2
0
        protected void OnUserPropertySet(UserPropertySetEvent e)
        {
            if (_properties == null)
            {
                _properties = new Dictionary<string, UserProperty>();
            }

            if (!_properties.ContainsKey(e.Name))
            {
                _properties.Add(e.Name, new UserProperty
                                            {
                                                Name = e.Name,
                                                Value = e.Value,
                                                Type = e.Type,
                                                Format = e.Format
                                            });
            }

            _properties[e.Name] = new UserProperty
                                      {
                                          Name = e.Name,
                                          Value = e.Value,
                                          Type = e.Type,
                                          Format = e.Format
                                      };
        }