Exemplo n.º 1
0
        /// <summary>
        /// Create a new abstract entity.
        /// </summary>
        /// <param name="Id">The unique entity identification.</param>
        /// <param name="CustomData">An optional dictionary of customer-specific data.</param>
        public AEMobilityEntity(TId Id,
                                IReadOnlyDictionary <String, Object> CustomData = null)

            : base(CustomData)

        {
            #region Initial checks

            if (Id.IsNullOrEmpty)
            {
                throw new ArgumentNullException(nameof(Id), "The given Id must not be null or empty!");
            }

            #endregion

            this._Ids = new List <TId> {
                Id
            };
            this.DataSource   = String.Empty;
            this.LastChange   = DateTime.UtcNow;
            this._UserDefined = new UserDefinedDictionary();

            this._UserDefined.OnPropertyChanged += (timestamp, eventtrackingid, sender, key, oldValue, newValue)
                                                   => OnPropertyChanged?.Invoke(timestamp, eventtrackingid, sender, key, oldValue, newValue);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create a new abstract entity.
        /// </summary>
        /// <param name="Ids">The unique entity identifications.</param>
        public AEMobilityEntity(IEnumerable <TId> Ids,
                                IReadOnlyDictionary <String, Object> CustomData = null)

            : base(CustomData)

        {
            #region Initial checks

            if (!Ids.SafeAny())
            {
                throw new ArgumentNullException(nameof(Ids), "The given enumeration of identifications must not be null!");
            }

            #endregion

            this._Ids         = new List <TId>(Ids);
            this.DataSource   = String.Empty;
            this.LastChange   = DateTime.UtcNow;
            this._UserDefined = new UserDefinedDictionary();

            this._UserDefined.OnPropertyChanged += (timestamp, eventtrackingid, sender, key, oldValue, newValue)
                                                   => OnPropertyChanged?.Invoke(timestamp, eventtrackingid, sender, key, oldValue, newValue);
        }