Inheritance: Ncqrs.Eventing.Sourcing.SourcedEvent, IIdentifiable
Ejemplo n.º 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);
        }
Ejemplo n.º 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
                                      };
        }