This repository was archived by the owner on Oct 20, 2022. It is now read-only.
forked from CoreHelpers/AzureStorageTable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRelatedTableAttribute.cs
More file actions
40 lines (35 loc) · 1.58 KB
/
RelatedTableAttribute.cs
File metadata and controls
40 lines (35 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using System.Collections.Generic;
using System.Text;
namespace CoreHelpers.WindowsAzure.Storage.Table.Attributes
{
public class RelatedTableAttribute : Attribute
{
/// <summary>
/// The partitionkey of the related table, if this is the name of a property on the model the property value will be used.
/// </summary>
public string PartitionKey { get; set; }
/// <summary>
/// The rowkey of the related table, if this is a property on the model, the property value will be loaded, if it is empty this will default to the name of the type.
/// </summary>
public string RowKey { get; set; }
/// <summary>
///
/// </summary>
/// <param name="partitionKey">The partitionkey of the related table, if this is the name of a property on the model the property value will be used.</param>
public RelatedTableAttribute(string partitionKey)
{
PartitionKey = partitionKey;
}
/// <summary>
///
/// </summary>
/// <param name="partitionKey">The partitionkey of the related table, if this is the name of a property on the model the property value will be used.</param>
/// <param name="rowKey">The rowkey of the related table, if this is a property on the model, the property value will be loaded, if it is empty this will default to the name of the type.</param>
public RelatedTableAttribute(string partitionKey, string rowKey)
{
PartitionKey = partitionKey;
RowKey = rowKey;
}
}
}