Skip to content

Commit c4ebea9

Browse files
committed
Add missing API docs and fix all docs warnings
Fixes #64
1 parent 850740b commit c4ebea9

12 files changed

+32
-10
lines changed

src/TableStorage/AttributedDocumentRepository`1.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Devlooped
66
{
77
/// <summary>
8-
/// An <see cref="IDocumentRepository{T}{T}"/> implementation which relies on the entity type <typeparamref name="T"/>
8+
/// An <see cref="IDocumentRepository{T}"/> implementation which relies on the entity type <typeparamref name="T"/>
99
/// being annotated with <see cref="PartitionKeyAttribute"/> and <see cref="RowKeyAttribute"/>, and
1010
/// optionally <see cref="TableAttribute"/> (defaults to type name).
1111
/// </summary>
@@ -22,6 +22,7 @@ partial class AttributedDocumentRepository<T> : DocumentRepository<T> where T :
2222
/// Initializes the repository using the given storage account.
2323
/// </summary>
2424
/// <param name="storageAccount">Storage account to connect to.</param>
25+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
2526
public AttributedDocumentRepository(CloudStorageAccount storageAccount, IDocumentSerializer? serializer = default)
2627
: base(storageAccount,
2728
TableRepository.GetDefaultTableName<T>(),

src/TableStorage/DocumentPartition.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static partial class DocumentPartition
2929
/// <typeparam name="T">The type of entity that the repository will manage.</typeparam>
3030
/// <param name="storageAccount">The storage account to use.</param>
3131
/// <param name="rowKey">Function to retrieve the row key for a given entity.</param>
32+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
3233
/// <returns>The new <see cref="ITablePartition{T}"/>.</returns>
3334
public static IDocumentPartition<T> Create<T>(
3435
CloudStorageAccount storageAccount,
@@ -45,6 +46,7 @@ public static IDocumentPartition<T> Create<T>(
4546
/// <param name="storageAccount">The storage account to use.</param>
4647
/// <param name="tableName">Table name to use.</param>
4748
/// <param name="rowKey">Function to retrieve the row key for a given entity.</param>
49+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
4850
/// <returns>The new <see cref="ITablePartition{T}"/>.</returns>
4951
public static IDocumentPartition<T> Create<T>(
5052
CloudStorageAccount storageAccount,
@@ -65,6 +67,7 @@ public static IDocumentPartition<T> Create<T>(
6567
/// If not provided, the <typeparamref name="T"/> <c>Name</c> will be used.</param>
6668
/// <param name="rowKey">Optional function to retrieve the row key for a given entity.
6769
/// If not provided, the class will need a property annotated with <see cref="RowKeyAttribute"/>.</param>
70+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
6871
/// <returns>The new <see cref="ITablePartition{T}"/>.</returns>
6972
public static IDocumentPartition<T> Create<T>(
7073
CloudStorageAccount storageAccount,

src/TableStorage/DocumentRepository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static partial class DocumentRepository
2323
/// If not provided, the class will need a property annotated with <see cref="PartitionKeyAttribute"/>.</param>
2424
/// <param name="rowKey">Optional function to retrieve the row key for a given entity.
2525
/// If not provided, the class will need a property annotated with <see cref="RowKeyAttribute"/>.</param>
26+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
2627
/// <returns>The new <see cref="ITableRepository{T}"/>.</returns>
2728
public static IDocumentRepository<T> Create<T>(
2829
CloudStorageAccount storageAccount,

src/TableStorage/DocumentRepository`1.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static DocumentRepository()
4747
/// <param name="tableName">The table that backs this repository.</param>
4848
/// <param name="partitionKey">A function to determine the partition key for an entity of type <typeparamref name="T"/>.</param>
4949
/// <param name="rowKey">A function to determine the row key for an entity of type <typeparamref name="T"/>.</param>
50+
/// <param name="serializer">Optional serializer to use instead of the default <see cref="DocumentSerializer.Default"/>.</param>
5051
protected internal DocumentRepository(CloudStorageAccount storageAccount, string tableName, Func<T, string> partitionKey, Func<T, string> rowKey, IDocumentSerializer serializer)
5152
{
5253
this.storageAccount = storageAccount;

src/TableStorage/IDocumentPartition`1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ partial interface IDocumentPartition<T> : ITableStoragePartition<T> where T : cl
1919
/// <example>
2020
/// var books = DocumentPartition.Create&lt;Book&gt;();
2121
/// await foreach (var book in books.EnumerateAsync(x =>
22-
/// x.PartitionKey == "Rick Riordan" &&
23-
/// x.RowKey.CompareTo("Percy Jackson") >= 0 &&
22+
/// x.PartitionKey == "Rick Riordan" &amp;&amp;
23+
/// x.RowKey.CompareTo("Percy Jackson") >= 0 &amp;&amp;
2424
/// x.Version == "1.0"))
2525
/// {
2626
/// Console.WriteLine(book.ISBN);

src/TableStorage/IDocumentRepository`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ partial interface IDocumentRepository<T> : ITableStorage<T> where T : class
1919
/// </summary>
2020
/// <example>
2121
/// var books = DocumentRepository.Create&lt;Book&gt;();
22-
/// await foreach (var book in books.EnumerateAsync(x => x.PartitionKey == "Rick Riordan" && x.DocumentType ))
22+
/// await foreach (var book in books.EnumerateAsync(x => x.PartitionKey == "Rick Riordan" &amp;&amp; x.DocumentType ))
2323
/// {
2424
/// Console.WriteLine(book.ISBN);
2525
/// }

src/TableStorage/ITablePartition`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ partial interface ITablePartition<T> : ITableStoragePartition<T> where T : class
2828
/// <example>
2929
/// var books = TablePartition.Create&lt;Book&gt;("Bestsellers");
3030
/// await foreach (var published in from book in books.CreateQuery()
31-
/// where book.IsPublished && book.Pages > 1000
31+
/// where book.IsPublished &amp;&amp; book.Pages > 1000
3232
/// select book)
3333
/// {
3434
/// Console.WriteLine(published.ISBN);

src/TableStorage/ITableRepository`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ partial interface ITableRepository<T> : ITableStorage<T> where T : class
2626
/// <example>
2727
/// var books = TableRepository.Create&lt;Book&gt;();
2828
/// await foreach (var published in from book in books.CreateQuery()
29-
/// where book.IsPublished && book.Pages > 1000
29+
/// where book.IsPublished &amp;&amp; book.Pages > 1000
3030
/// select book)
3131
/// {
3232
/// Console.WriteLine(published.ISBN);

src/TableStorage/TablePartition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ static partial class TablePartition
2323
public const string DefaultTableName = "Entities";
2424

2525
/// <summary>
26-
/// Creates an <see cref="ITablePartition{ITableEntity}"/>, using
27-
/// <see cref="DefaultTableName"/> as the table name and the
28-
/// <typeparamref name="T"/> <c>Name</c> as the partition key.
26+
/// Creates an <see cref="ITablePartition{ITableEntity}"/>.
2927
/// </summary>
3028
/// <param name="storageAccount">The storage account to use.</param>
29+
/// <param name="tableName">Table name to use.</param>
30+
/// <param name="partitionKey">Fixed partition key to scope entity persistence.</param>
3131
/// <param name="updateStrategy">Strategy to apply when updating an existing entity. Defaults to <see cref="UpdateStrategy.Replace"/>.</param>
3232
/// <returns>The new <see cref="ITablePartition{TEntity}"/>.</returns>
3333
public static ITablePartition<ITableEntity> Create(CloudStorageAccount storageAccount, string tableName, string partitionKey, UpdateStrategy? updateStrategy = default)

src/TableStorage/TableStorageAttribute.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
namespace Devlooped
1111
{
12+
/// <summary>
13+
/// Base class for <see cref="PartitionKeyAttribute"/> and <see cref="RowKeyAttribute"/>
14+
/// that defines common behavior.
15+
/// </summary>
1216
abstract partial class TableStorageAttribute : Attribute
1317
{
1418
static readonly ConcurrentDictionary<(Type EntityType, Type AttributeType), Expression> getters = new();
@@ -20,10 +24,18 @@ abstract partial class TableStorageAttribute : Attribute
2024
' ', '/', '\\', '#', '?', '\t', '\n', '\r', '+', '|', '[', ']', '{', '}', '<', '>', '$', '^', '&'
2125
});
2226

27+
/// <summary>
28+
/// Creates an expression for retrieving the value for the given entity and attribute type.
29+
/// </summary>
30+
/// <typeparam name="TEntity">The entity type.</typeparam>
31+
/// <typeparam name="TAttribute">The attribute type.</typeparam>
2332
protected static Expression<Func<TEntity, string>> CreateGetter<TEntity, TAttribute>() where TAttribute : Attribute
2433
=> (Expression<Func<TEntity, string>>)getters.GetOrAdd((typeof(TEntity), typeof(TAttribute)),
2534
(Func<(Type, Type), Expression<Func<TEntity, string>>>)(_ => CreateGetterCore<TEntity, TAttribute>()));
2635

36+
/// <summary>
37+
/// Same as <see cref="CreateGetter{TEntity, TAttribute}"/> but compiled to a delegate.
38+
/// </summary>
2739
protected static Func<TEntity, string> CreateCompiledGetter<TEntity, TAttribute>() where TAttribute : Attribute
2840
=> (Func<TEntity, string>)compiledGetters.GetOrAdd((typeof(TEntity), typeof(TAttribute)), _ => CreateGetter<TEntity, TAttribute>().Compile());
2941

0 commit comments

Comments
 (0)