예제 #1
0
        public Metadata Without(Metadatum metadatum)
        {
            var copy = Array.FindAll(_metadata,
                                     candidate => !candidate.Equals(metadatum));

            return(new Metadata(copy));
        }
예제 #2
0
        public Metadata With(Metadatum metadatum)
        {
            var copy = new Metadatum[_metadata.Length + 1];

            Array.Copy(_metadata, copy, _metadata.Length);
            copy[copy.Length - 1] = metadatum;
            return(new Metadata(copy));
        }
예제 #3
0
        public Metadata With(Metadatum[] metadata)
        {
            if (metadata == null)
            {
                throw new ArgumentNullException(nameof(metadata));
            }
            var copy = new Metadatum[_metadata.Length + metadata.Length];

            Array.Copy(_metadata, copy, _metadata.Length);
            Array.Copy(metadata, 0, copy, _metadata.Length, metadata.Length);
            return(new Metadata(copy));
        }
예제 #4
0
 public Metadata Add(Metadatum metadatum)
 {
     return(this.With(metadatum));
 }