示例#1
0
        public MqChunkAttribute Attribute(string name, bool createIfNotFound = true)
        {
            var value = this.Attributes.FirstOrDefault(_ => _.Name.Equals(name, StringComparison.CurrentCulture));

            if (createIfNotFound && value == null)
            {
                this.Attributes.Add(value = new MqChunkAttribute
                {
                    Name = name,
                });
            }

            return(value);
        }
示例#2
0
        public MqChunkAttribute Attribute(string name, bool createIfNotFound = true)
        {
            var value = this.Attributes.FirstOrDefault(_ => _.Name.Equals(name, StringComparison.CurrentCulture));

            if (createIfNotFound && value == null)
                this.Attributes.Add(value = new MqChunkAttribute
                {
                    Name = name,
                });

            return value;
        }