From ed29448a21c489987adc58e620647429ed74005d Mon Sep 17 00:00:00 2001 From: Leprox43 Date: Sat, 26 Aug 2023 16:21:20 +0200 Subject: [PATCH 1/2] Fix Prefix property and init of Tags collection in AndOperator object (#782) --- Minio/DataModel/ILM/AndOperator.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Minio/DataModel/ILM/AndOperator.cs b/Minio/DataModel/ILM/AndOperator.cs index 5e540ab26..75c121ffa 100644 --- a/Minio/DataModel/ILM/AndOperator.cs +++ b/Minio/DataModel/ILM/AndOperator.cs @@ -1,4 +1,4 @@ -/* +/* * MinIO .NET Library for Amazon S3 Compatible Cloud Storage, (C) 2021 MinIO, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,7 +38,8 @@ public AndOperator() public AndOperator(string prefix, IList tag) { Prefix = prefix; - if (tag?.Count > 0) Tags = new Collection(tag); + if (tag?.Count > 0) + Tags = new Collection(tag); } public AndOperator(string prefix, IDictionary tags) @@ -46,10 +47,15 @@ public AndOperator(string prefix, IDictionary tags) Prefix = prefix; if (tags is null || tags.Count == 0) return; - foreach (var item in tags) Tags.Add(new Tag(item.Key, item.Value)); + + Tags = new Collection(); + + foreach (var item in tags) + Tags.Add(new Tag(item.Key, item.Value)); } - [XmlElement("Prefix")] internal string Prefix { get; set; } + [XmlElement("Prefix")] + public string Prefix { get; set; } [XmlElement(ElementName = "Tag", IsNullable = false)] public Collection Tags { get; set; } From bf5d8f70580a3d357dd24e91d999516d1c0b46f7 Mon Sep 17 00:00:00 2001 From: Leprox43 Date: Wed, 30 Aug 2023 09:35:22 +0200 Subject: [PATCH 2/2] Run dotnet regitlint on modified files (#782) --- Minio/DataModel/ILM/AndOperator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Minio/DataModel/ILM/AndOperator.cs b/Minio/DataModel/ILM/AndOperator.cs index 75c121ffa..a50ce35ad 100644 --- a/Minio/DataModel/ILM/AndOperator.cs +++ b/Minio/DataModel/ILM/AndOperator.cs @@ -54,8 +54,7 @@ public AndOperator(string prefix, IDictionary tags) Tags.Add(new Tag(item.Key, item.Value)); } - [XmlElement("Prefix")] - public string Prefix { get; set; } + [XmlElement("Prefix")] public string Prefix { get; set; } [XmlElement(ElementName = "Tag", IsNullable = false)] public Collection Tags { get; set; }