-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCollectionName.cs
More file actions
30 lines (25 loc) · 832 Bytes
/
Copy pathCollectionName.cs
File metadata and controls
30 lines (25 loc) · 832 Bytes
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
using System;
namespace Signalr.MongoDb
{
[AttributeUsage(AttributeTargets.Class, Inherited = true)]
public class CollectionName : Attribute
{
/// <summary>
/// Initializes a new instance of the CollectionName class attribute with the desired name.
/// </summary>
/// <param name="value">Name of the collection.</param>
public CollectionName(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException("Empty collectionname not allowed", "value");
}
Name = value;
}
/// <summary>
/// Gets the name of the collection.
/// </summary>
/// <value>The name of the collection.</value>
public string Name { get; private set; }
}
}