Skip to content

Commit 0e9c6ae

Browse files
committed
del trash
1 parent aaaacef commit 0e9c6ae

File tree

92 files changed

+10282
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+10282
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the StronglyTypedId source generator
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
#pragma warning disable 1591 // publicly visible type or member must be documented
11+
12+
#if STRONGLY_TYPED_ID_EMBED_ATTRIBUTES
13+
14+
using System;
15+
16+
namespace StronglyTypedIds
17+
{
18+
/// <summary>
19+
/// Place on partial structs to make the type a strongly-typed ID
20+
/// </summary>
21+
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
22+
[System.Diagnostics.Conditional("STRONGLY_TYPED_ID_USAGES")]
23+
internal sealed class StronglyTypedIdAttribute : Attribute
24+
{
25+
/// <summary>
26+
/// Make the struct a strongly typed ID
27+
/// </summary>
28+
/// <param name="backingType">The <see cref="Type"/> to use to store the strongly-typed ID value.
29+
/// If not set, uses <see cref="StronglyTypedIdDefaultsAttribute.BackingType"/>, which defaults to <see cref="StronglyTypedIdBackingType.Guid"/></param>
30+
/// <param name="converters">Converters to create for serializing/deserializing the strongly-typed ID value.
31+
/// If not set, uses <see cref="StronglyTypedIdDefaultsAttribute.Converters"/>, which defaults to <see cref="StronglyTypedIdConverter.NewtonsoftJson"/>
32+
/// and <see cref="StronglyTypedIdConverter.TypeConverter"/></param>
33+
/// <param name="implementations">Interfaces and patterns the strongly typed id should implement
34+
/// If not set, uses <see cref="StronglyTypedIdDefaultsAttribute.Implementations"/>, which defaults to <see cref="StronglyTypedIdImplementations.IEquatable"/>
35+
/// and <see cref="StronglyTypedIdImplementations.IComparable"/></param>
36+
public StronglyTypedIdAttribute(
37+
StronglyTypedIdBackingType backingType = StronglyTypedIdBackingType.Default,
38+
StronglyTypedIdConverter converters = StronglyTypedIdConverter.Default,
39+
StronglyTypedIdImplementations implementations = StronglyTypedIdImplementations.Default)
40+
{
41+
BackingType = backingType;
42+
Converters = converters;
43+
Implementations = implementations;
44+
}
45+
46+
/// <summary>
47+
/// The <see cref="Type"/> to use to store the strongly-typed ID value
48+
/// </summary>
49+
public StronglyTypedIdBackingType BackingType { get; }
50+
51+
/// <summary>
52+
/// JSON library used to serialize/deserialize strongly-typed ID value
53+
/// </summary>
54+
public StronglyTypedIdConverter Converters { get; }
55+
56+
/// <summary>
57+
/// Interfaces and patterns the strongly typed id should implement
58+
/// </summary>
59+
public StronglyTypedIdImplementations Implementations { get; }
60+
}
61+
}
62+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the StronglyTypedId source generator
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
#pragma warning disable 1591 // publicly visible type or member must be documented
11+
12+
#if STRONGLY_TYPED_ID_EMBED_ATTRIBUTES
13+
14+
using System;
15+
16+
namespace StronglyTypedIds
17+
{
18+
/// <summary>
19+
/// The <see cref="Type"/> to use to store the value of a strongly-typed ID
20+
/// </summary>
21+
internal enum StronglyTypedIdBackingType
22+
{
23+
/// <summary>
24+
/// Use the default backing type (either the globally configured default, or Guid)
25+
/// </summary>
26+
Default = 0,
27+
28+
Guid = 1,
29+
Int = 2,
30+
String = 3,
31+
Long = 4,
32+
NullableString = 5,
33+
MassTransitNewId = 6,
34+
}
35+
}
36+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the StronglyTypedId source generator
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
#pragma warning disable 1591 // publicly visible type or member must be documented
11+
12+
#if STRONGLY_TYPED_ID_EMBED_ATTRIBUTES
13+
14+
using System;
15+
16+
namespace StronglyTypedIds
17+
{
18+
/// <summary>
19+
/// Converters used to to serialize/deserialize strongly-typed ID values
20+
/// </summary>
21+
[Flags]
22+
internal enum StronglyTypedIdConverter
23+
{
24+
// Used with HasFlag, so needs to be 1, 2, 4 etc
25+
26+
/// <summary>
27+
/// Don't create any converters for the strongly typed ID
28+
/// </summary>
29+
None = 0,
30+
31+
/// <summary>
32+
/// Use the default converters for the strongly typed Id.
33+
/// This will be the value provided in the <see cref="StronglyTypedIdDefaultsAttribute"/>, which falls back to
34+
/// <see cref="TypeConverter"/> and <see cref="NewtonsoftJson"/>
35+
/// </summary>
36+
Default = 1,
37+
38+
/// <summary>
39+
/// Creates a <see cref="TypeConverter"/> for converting from the strongly typed ID to and from a string
40+
/// </summary>
41+
TypeConverter = 2,
42+
43+
/// <summary>
44+
/// Creates a Newtonsoft.Json.JsonConverter for serializing the strongly typed id to its primitive value
45+
/// </summary>
46+
NewtonsoftJson = 4,
47+
48+
/// <summary>
49+
/// Creates a System.Text.Json.Serialization.JsonConverter for serializing the strongly typed id to its primitive value
50+
/// </summary>
51+
SystemTextJson = 8,
52+
53+
/// <summary>
54+
/// Creates an EF Core Value Converter for extracting the primitive value
55+
/// </summary>
56+
EfCoreValueConverter = 16,
57+
58+
/// <summary>
59+
/// Creates a Dapper TypeHandler for converting to and from the type
60+
/// </summary>
61+
DapperTypeHandler = 32,
62+
63+
/// <summary>
64+
/// Creates a Swagger SchemaFilter for OpenApi documentation
65+
/// </summary>
66+
SwaggerSchemaFilter = 64,
67+
68+
}
69+
}
70+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the StronglyTypedId source generator
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
#pragma warning disable 1591 // publicly visible type or member must be documented
11+
12+
#if STRONGLY_TYPED_ID_EMBED_ATTRIBUTES
13+
14+
using System;
15+
16+
namespace StronglyTypedIds
17+
{
18+
/// <summary>
19+
/// Used to control the default Place on partial structs to make the type a strongly-typed ID
20+
/// </summary>
21+
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
22+
[System.Diagnostics.Conditional("STRONGLY_TYPED_ID_USAGES")]
23+
internal sealed class StronglyTypedIdDefaultsAttribute : Attribute
24+
{
25+
/// <summary>
26+
/// Set the default values used for strongly typed ids
27+
/// </summary>
28+
/// <param name="backingType">The <see cref="Type"/> to use to store the strongly-typed ID value.
29+
/// Defaults to <see cref="StronglyTypedIdBackingType.Guid"/></param>
30+
/// <param name="converters">JSON library used to serialize/deserialize strongly-typed ID value.
31+
/// Defaults to <see cref="StronglyTypedIdConverter.NewtonsoftJson"/> and <see cref="StronglyTypedIdConverter.TypeConverter"/></param>
32+
/// <param name="implementations">Interfaces and patterns the strongly typed id should implement
33+
/// Defaults to <see cref="StronglyTypedIdImplementations.IEquatable"/> and <see cref="StronglyTypedIdImplementations.IComparable"/></param>
34+
public StronglyTypedIdDefaultsAttribute(
35+
StronglyTypedIdBackingType backingType = StronglyTypedIdBackingType.Default,
36+
StronglyTypedIdConverter converters = StronglyTypedIdConverter.Default,
37+
StronglyTypedIdImplementations implementations = StronglyTypedIdImplementations.Default)
38+
{
39+
BackingType = backingType;
40+
Converters = converters;
41+
Implementations = implementations;
42+
}
43+
44+
/// <summary>
45+
/// The default <see cref="Type"/> to use to store the strongly-typed ID values.
46+
/// </summary>
47+
public StronglyTypedIdBackingType BackingType { get; }
48+
49+
/// <summary>
50+
/// The default converters to create for serializing/deserializing strongly-typed ID values.
51+
/// </summary>
52+
public StronglyTypedIdConverter Converters { get; }
53+
54+
/// <summary>
55+
/// Interfaces and patterns the strongly typed id should implement
56+
/// </summary>
57+
public StronglyTypedIdImplementations Implementations { get; }
58+
}
59+
}
60+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by the StronglyTypedId source generator
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
#pragma warning disable 1591 // publicly visible type or member must be documented
11+
12+
#if STRONGLY_TYPED_ID_EMBED_ATTRIBUTES
13+
14+
using System;
15+
16+
namespace StronglyTypedIds
17+
{
18+
/// <summary>
19+
/// Interfaces and patterns the strongly typed id should implement
20+
/// </summary>
21+
[Flags]
22+
internal enum StronglyTypedIdImplementations
23+
{
24+
// Used with HasFlag, so needs to be 1, 2, 4, 8 etc
25+
26+
/// <summary>
27+
/// Don't implement any additional members for the strongly typed ID
28+
/// </summary>
29+
None = 0,
30+
31+
/// <summary>
32+
/// Use the default implementations for the strongly typed Id.
33+
/// This will be the value provided in the <see cref="StronglyTypedIdDefaultsAttribute"/>, which falls back to
34+
/// <see cref="IEquatable"/> and <see cref="IComparable"/>
35+
/// </summary>
36+
Default = 1,
37+
38+
// ReSharper disable once InconsistentNaming
39+
/// <summary>
40+
/// Implement the <see cref="IEquatable{T}"/> interface
41+
/// </summary>
42+
IEquatable = 2,
43+
44+
// ReSharper disable once InconsistentNaming
45+
/// <summary>
46+
/// Implement the <see cref="IComparable{T}"/> interface
47+
/// </summary>
48+
IComparable = 4,
49+
50+
// ReSharper disable once InconsistentNaming
51+
/// <summary>
52+
/// Implement the <see cref="IParsable{T}"/> interface
53+
/// </summary>
54+
IParsable = 8
55+
}
56+
}
57+
58+
#endif

0 commit comments

Comments
 (0)