59 instantiations of EnumGroupAndName
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsMetadataProvider.cs (1)
194
new
EnumGroupAndName
(
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (58)
DataAnnotationsMetadataProviderTest.cs (58)
820
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Zero", string.Empty), "0"),
821
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
822
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "dos value"), "2"),
823
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "tres value"), "3"),
824
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "name from resources"), "-2"),
825
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Negatives", "menos uno value"), "-1"),
873
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Zero", string.Empty), "0"),
874
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
875
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "dos"), "2"),
876
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "tres"), "3"),
877
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "name from resources"), "-2"),
878
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Negatives", "menos uno"), "-1"),
885
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Zero", string.Empty), "0"),
886
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
887
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "dos"), "2"),
888
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "tres"), "3"),
889
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, "name from resources"), "-2"),
890
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
("Negatives", "menos uno"), "-1"),
899
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Zero)), "0"),
900
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.None)), "0"),
901
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.One)), "1"),
902
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Two)), "2"),
903
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Duece)), "2"),
904
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Three)), "3"),
905
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.MoreThanTwo)), "3"),
912
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Zero)), "0"),
913
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.None)), "0"),
914
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.One)), "1"),
915
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Two)), "2"),
916
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Duece)), "2"),
917
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.Three)), "3"),
918
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDuplicates.MoreThanTwo)), "3"),
925
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Zero)), "0"),
926
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.One)), "1"),
927
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Two)), "2"),
928
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Four)), "4"),
929
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.All)), "-1"),
936
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Zero)), "0"),
937
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.One)), "1"),
938
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Two)), "2"),
939
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.Four)), "4"),
940
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFlags.All)), "-1"),
947
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Zero)), "0"),
948
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.One)), "1"),
949
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Two)), "2"),
950
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Three)), "3"),
951
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.MinusTwo)), "-2"),
952
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.MinusOne)), "-1"),
959
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Zero)), "0"),
960
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.One)), "1"),
961
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Two)), "2"),
962
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.Three)), "3"),
963
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.MinusTwo)), "-2"),
964
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithFields.MinusOne)), "-1"),
1000
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayOrder.Three)), "2"),
1001
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayOrder.Two)), "1"),
1002
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayOrder.One)), "0"),
1003
new KeyValuePair<EnumGroupAndName, string>(new
EnumGroupAndName
(string.Empty, nameof(EnumWithDisplayOrder.Null)), "3"),
89 references to EnumGroupAndName
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcModelMetadata.cs (1)
29
public override IEnumerable<KeyValuePair<
EnumGroupAndName
, string>> EnumGroupedDisplayNamesAndValues { get; }
Microsoft.AspNetCore.Mvc.Abstractions (3)
ModelBinding\EnumGroupAndName.cs (2)
14
/// Initializes a new instance of the <see cref="
EnumGroupAndName
"/> structure. This constructor should
29
/// Initializes a new instance of the <see cref="
EnumGroupAndName
"/> structure.
ModelBinding\ModelMetadata.cs (1)
270
public abstract IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>? EnumGroupedDisplayNamesAndValues { get; }
Microsoft.AspNetCore.Mvc.Abstractions.Test (1)
ModelBinding\ModelMetadataTest.cs (1)
556
public override IEnumerable<KeyValuePair<
EnumGroupAndName
, string>> EnumGroupedDisplayNamesAndValues
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
EndpointModelMetadata.cs (1)
29
public override IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>? EnumGroupedDisplayNamesAndValues { get; }
Microsoft.AspNetCore.Mvc.Core (2)
ModelBinding\Metadata\DefaultModelMetadata.cs (1)
230
public override IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>? EnumGroupedDisplayNamesAndValues
ModelBinding\Metadata\DisplayMetadata.cs (1)
145
public IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>? EnumGroupedDisplayNamesAndValues { get; set; }
Microsoft.AspNetCore.Mvc.DataAnnotations (2)
DataAnnotationsMetadataProvider.cs (2)
175
var groupedDisplayNamesAndValues = new List<KeyValuePair<
EnumGroupAndName
, string>>();
193
groupedDisplayNamesAndValues.Add(new KeyValuePair<
EnumGroupAndName
, string>(
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (79)
DataAnnotationsMetadataProviderTest.cs (79)
818
var expectedKeyValuePairs = new List<KeyValuePair<
EnumGroupAndName
, string>>
820
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Zero", string.Empty), "0"),
821
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
822
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "dos value"), "2"),
823
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "tres value"), "3"),
824
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "name from resources"), "-2"),
825
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Negatives", "menos uno value"), "-1"),
859
public static TheoryData<Type, IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>> EnumDisplayNamesData
863
return new TheoryData<Type, IEnumerable<KeyValuePair<
EnumGroupAndName
, string>>>
867
{ typeof(EmptyEnum), new List<KeyValuePair<
EnumGroupAndName
, string>>() },
868
{ typeof(EmptyEnum?), new List<KeyValuePair<
EnumGroupAndName
, string>>() },
871
new List<KeyValuePair<
EnumGroupAndName
, string>>
873
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Zero", string.Empty), "0"),
874
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
875
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "dos"), "2"),
876
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "tres"), "3"),
877
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "name from resources"), "-2"),
878
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Negatives", "menos uno"), "-1"),
883
new List<KeyValuePair<
EnumGroupAndName
, string>>
885
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Zero", string.Empty), "0"),
886
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayNames.One)), "1"),
887
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "dos"), "2"),
888
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "tres"), "3"),
889
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, "name from resources"), "-2"),
890
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName("Negatives", "menos uno"), "-1"),
897
new List<KeyValuePair<
EnumGroupAndName
, string>>
899
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Zero)), "0"),
900
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.None)), "0"),
901
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.One)), "1"),
902
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Two)), "2"),
903
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Duece)), "2"),
904
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Three)), "3"),
905
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.MoreThanTwo)), "3"),
910
new List<KeyValuePair<
EnumGroupAndName
, string>>
912
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Zero)), "0"),
913
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.None)), "0"),
914
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.One)), "1"),
915
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Two)), "2"),
916
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Duece)), "2"),
917
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.Three)), "3"),
918
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDuplicates.MoreThanTwo)), "3"),
923
new List<KeyValuePair<
EnumGroupAndName
, string>>
925
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Zero)), "0"),
926
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.One)), "1"),
927
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Two)), "2"),
928
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Four)), "4"),
929
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.All)), "-1"),
934
new List<KeyValuePair<
EnumGroupAndName
, string>>
936
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Zero)), "0"),
937
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.One)), "1"),
938
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Two)), "2"),
939
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.Four)), "4"),
940
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFlags.All)), "-1"),
945
new List<KeyValuePair<
EnumGroupAndName
, string>>
947
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Zero)), "0"),
948
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.One)), "1"),
949
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Two)), "2"),
950
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Three)), "3"),
951
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.MinusTwo)), "-2"),
952
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.MinusOne)), "-1"),
957
new List<KeyValuePair<
EnumGroupAndName
, string>>
959
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Zero)), "0"),
960
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.One)), "1"),
961
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Two)), "2"),
962
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.Three)), "3"),
963
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.MinusTwo)), "-2"),
964
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithFields.MinusOne)), "-1"),
975
IEnumerable<KeyValuePair<
EnumGroupAndName
, string>> expectedKeyValuePairs)
998
var expectedKeyValuePairs = new List<KeyValuePair<
EnumGroupAndName
, string>>
1000
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayOrder.Three)), "2"),
1001
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayOrder.Two)), "1"),
1002
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayOrder.One)), "0"),
1003
new KeyValuePair<
EnumGroupAndName
, string>(new EnumGroupAndName(string.Empty, nameof(EnumWithDisplayOrder.Null)), "3"),
1681
private IEnumerable<KeyValuePair<
EnumGroupAndName
, string>> GetLocalizedEnumGroupedDisplayNamesAndValues(
1735
private class KVPEnumGroupAndNameComparer : IEqualityComparer<KeyValuePair<
EnumGroupAndName
, string>>
1737
public static readonly IEqualityComparer<KeyValuePair<
EnumGroupAndName
, string>> Instance = new KVPEnumGroupAndNameComparer();
1743
public bool Equals(KeyValuePair<
EnumGroupAndName
, string> x, KeyValuePair<
EnumGroupAndName
, string> y)
1752
public int GetHashCode(KeyValuePair<
EnumGroupAndName
, string> obj)