Beispiel #1
0
        public Property(string description, string address, int number, IEnumerable <PropertyUnity> unities)
        {
            AssertionConcern.AssertArgumentNotEmpty(description, $"Parameter {nameof(description)} cannot be empty or null");
            AssertionConcern.AssertArgumentNotEmpty(address, $"Parameter {nameof(address)} cannot be empty or null");
            AssertionConcern.AssertArgumentRange(number, 0, int.MaxValue, $"Parameter {nameof(number)} is out of range {0}, {int.MaxValue}");
            EnumerableConcern.AssertMinimumLength(unities, 1, $"Parameter {nameof(unities)} need at least 1 item");

            this.Id          = Guid.NewGuid();
            this.Description = description;
            this.Address     = address;
            this.Number      = number;
            this.Unities     = unities;
        }
Beispiel #2
0
 public void SetUnities(IEnumerable <PropertyUnity> unities)
 {
     EnumerableConcern.AssertMinimumLength(unities, 1, $"Parameter {nameof(unities)} need at least 1 item");
     this.Unities = unities;
 }