コード例 #1
0
        /// <summary>
        /// This method is used to change the internal state of the object
        /// An Event tracking all the changes is store in the "changes" collection of the Aggregate root base class
        /// </summary>
        public void ChangeValues(
            int ville,
            int pays,
            int typeVoie,
            int categorieAdresse,
            string numVoie,
            string nomVoie        = null,
            string complementVoie = null)
        {
            var pmChangedValuesEvent = new OrganizationChangedValuesEvent <Address>();

            pmChangedValuesEvent.AsOf           = DateTime.Now;
            pmChangedValuesEvent.AggregateId    = AggregateId;
            pmChangedValuesEvent.EventId        = Guid.NewGuid();
            pmChangedValuesEvent.OldValue       = new Address(Id, Ville, Pays, TypeVoie, CategorieAdresse, NumVoie, NomVoie, ComplementVoie);
            pmChangedValuesEvent.OrganizationId = Id;
            pmChangedValuesEvent.NewValue       = new Address(Id, ville, pays, typeVoie, categorieAdresse, numVoie, nomVoie, complementVoie);

            Ville            = ville;
            Pays             = pays;
            TypeVoie         = typeVoie;
            CategorieAdresse = categorieAdresse;
            NumVoie          = numVoie;
            NomVoie          = nomVoie;
            ComplementVoie   = complementVoie;

            ApplyTrackingChange(pmChangedValuesEvent);
        }
コード例 #2
0
        /// <summary>
        /// This method is used to change the internal state of the object
        /// An Event tracking all the changes is store in the "changes" collection of the Aggregate root base class
        /// </summary>
        public void ChangeValues(
            string raisonSociale,
            string formeJuridique = null,
            int?effectif          = null,
            string siret          = null,
            string naf            = null,
            string identifiantConventionCollective = null)
        {
            var pmChangedValuesEvent = new OrganizationChangedValuesEvent <Organization>();

            pmChangedValuesEvent.AsOf           = DateTime.Now;
            pmChangedValuesEvent.AggregateId    = AggregateId;
            pmChangedValuesEvent.EventId        = Guid.NewGuid();
            pmChangedValuesEvent.OldValue       = new Organization(Id, null, RaisonSociale, FormeJuridique, Effectif, SIRET, CodeNAF, IdentifiantConventionCollective);
            pmChangedValuesEvent.OrganizationId = Id;
            pmChangedValuesEvent.NewValue       = new Organization(Id, null, raisonSociale, formeJuridique, effectif, siret, naf, identifiantConventionCollective);

            RaisonSociale  = raisonSociale;
            FormeJuridique = formeJuridique;
            Effectif       = effectif;
            SIRET          = siret;
            CodeNAF        = naf;
            IdentifiantConventionCollective = identifiantConventionCollective;

            ApplyTrackingChange(pmChangedValuesEvent);
        }