Skip to content

Commit

Permalink
task: updates to xml comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dtanglr committed Jan 17, 2024
1 parent 5e870ab commit 90ccad7
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,8 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# DocFx generated files
/docs/**/toc.yml
/docs/api/
_site
4 changes: 2 additions & 2 deletions src/Primitively.Abstractions/ByteAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Primitively;

/// <summary>
/// Make a readonly record struct that encapsulates a Unsigned 8-bit integer primitive value
/// with a default range of: 0 to 255
/// Make a readonly record struct that encapsulates a Unsigned 8-bit integer primitive value
/// with a default range of: 0 to 255
/// </summary>
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
[Conditional(Constants.ConditionalCompilationSymbol)]
Expand Down
46 changes: 46 additions & 0 deletions src/Primitively.Abstractions/DataType.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
namespace Primitively;

/// <summary>
/// Data types supported by Primitively types
/// </summary>
public enum DataType
{
/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="Byte"/> value
/// </summary>
Byte,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="DateOnly"/> value
/// </summary>
DateOnly,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="Guid"/> value
/// </summary>
Guid,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="Int"/> value
/// </summary>
Int,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="Long"/> value
/// </summary>
Long,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="SByte"/> value
/// </summary>
SByte,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="Short"/> value
/// </summary>
Short,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="String"/> value
/// </summary>
String,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="UInt"/> value
/// </summary>
UInt,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="ULong"/> value
/// </summary>
ULong,

/// <summary>
/// Represents a Primitively type that encapsulates a <see cref="UShort"/> value
/// </summary>
UShort
}
4 changes: 2 additions & 2 deletions src/Primitively.Abstractions/DateOnlyAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Primitively;

/// <summary>
/// Make a readonly record struct that encapsulates a DateOnly primitive value
/// with default Iso8601 format of yyyy-MM-dd
/// Make a readonly record struct that encapsulates a DateOnly primitive value
/// with default Iso8601 format of yyyy-MM-dd
/// </summary>
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
[Conditional(Constants.ConditionalCompilationSymbol)]
Expand Down
3 changes: 2 additions & 1 deletion src/Primitively.Abstractions/GuidAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Primitively;

/// <summary>
/// Make a readonly record struct that encapsulates a GUID primitive value
/// Make a readonly record struct that encapsulates a GUID primitive value
/// </summary>
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
[Conditional(Constants.ConditionalCompilationSymbol)]
Expand All @@ -20,5 +20,6 @@ public GuidAttribute(Specifier specifier)
}

public Specifier Specifier { get; }

public bool ImplementIValidatableObject { get; set; }
}
26 changes: 21 additions & 5 deletions src/Primitively.Abstractions/IPrimitive.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
namespace Primitively;

/// <summary>
/// The interface that all source generated Primitively types implement.
/// </summary>
public interface IPrimitive
{
/// <summary>
/// Flag indicating the instance has a valid value.
/// </summary>
/// <remarks>
/// Attempts to instantiate a Primitively type with an invalid value will result in a default instance with no value.
/// </remarks>
public bool HasValue { get; }

/// <summary>
/// The .net type of the value that the instance encapsulates.
/// </summary>
public Type ValueType { get; }

/// <summary>
/// The <see cref="DataType"/> enum representation of type that the instance encapsulates.
/// </summary>
public DataType DataType { get; }

/// <summary>
/// The value encapsulated by this instance
/// </summary>
/// <remarks>
/// Attempts to instantiate a Primitively type with an invalid value will result in a default instance with no value.
/// </remarks>
public object Value { get; }
}

public interface IPrimitive<out T> : IPrimitive
{
public new T Value { get; }
}
13 changes: 13 additions & 0 deletions src/Primitively.Abstractions/IPrimitive`1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace Primitively;

/// <summary>
/// The generic interface that all source generated Primitively types implement
/// </summary>
/// <typeparam name="T">The .net type of the encapsulated value</typeparam>
public interface IPrimitive<out T> : IPrimitive
{
/// <summary>
/// The value of the Primitively type
/// </summary>
public new T Value { get; }
}
4 changes: 2 additions & 2 deletions src/Primitively.Abstractions/IntAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Primitively;

/// <summary>
/// Make a readonly record struct that encapsulates a Signed 32-bit integer primitive value
/// with a default range of: -2,147,483,648 to 2,147,483,647
/// Make a readonly record struct that encapsulates a Signed 32-bit integer primitive value
/// with a default range of: -2,147,483,648 to 2,147,483,647
/// </summary>
[AttributeUsage(AttributeTargets.Struct, Inherited = false, AllowMultiple = false)]
[Conditional(Constants.ConditionalCompilationSymbol)]
Expand Down

0 comments on commit 90ccad7

Please sign in to comment.