Example #1
0
        public Task RegisterBirth(PersonAttributes props)
        {
            if (this.State.FirstName == null)
            {
                RaiseEvent(new PersonRegistered(props.FirstName, props.LastName, props.Gender));

                return(ConfirmEvents());
            }

            return(Task.CompletedTask);
        }
        /// <summary>
        /// Used to make sure the attributes and their definitions match up.
        /// </summary>
        public void SortAttributeLists( )
        {
            // first, sort the model's attributes
            FamilyAttributes.Sort(delegate(Dictionary <string, string> x, Dictionary <string, string> y)
            {
                if (int.Parse(x["attributeId"]) < int.Parse(y["attributeId"]))
                {
                    return(-1);
                }

                return(1);
            });

            PersonAttributes.Sort(delegate(Dictionary <string, string> x, Dictionary <string, string> y)
            {
                if (int.Parse(x["attributeId"]) < int.Parse(y["attributeId"]))
                {
                    return(-1);
                }

                return(1);
            });
        }
Example #3
0
 public PersonAttributes GetPersonAttributes()
 {
     return(PersonAttributes.FromJson(Attributes));
 }
Example #4
0
 public void SetPersonAttributes(PersonAttributes value)
 {
     Attributes = value.ToJson();
 }
Example #5
0
 public void SetPersonAttributes(PersonAttributes value)
 {
     Content = value.ToJson();
 }
Example #6
0
 public Task RegisterBirth(PersonAttributes props)
 {
     return(RaiseStateEvent(new PersonRegistered(props.FirstName, props.LastName, props.Gender)));
 }