forked from PHOENIXCONTACT/MORYX-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReferenceOverrideAttribute.cs
34 lines (30 loc) · 1.01 KB
/
ReferenceOverrideAttribute.cs
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
// Copyright (c) 2023, Phoenix Contact GmbH & Co. KG
// Licensed under the Apache License, Version 2.0
using System;
namespace Moryx.AbstractionLayer.Resources
{
/// <summary>
/// Attribute to decorate properties that override the lower type bound of base class references. Those properties only
/// and improve type safety of the references
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public class ReferenceOverrideAttribute : Attribute
{
/// <summary>
/// Name of the source property
/// </summary>
public string Source { get; private set; }
/// <summary>
/// Automatically save changes to the collection
/// </summary>
public bool AutoSave { get; set; }
/// <summary>
/// Create a new reference override from a source property
/// </summary>
/// <param name="source"></param>
public ReferenceOverrideAttribute(string source)
{
Source = source;
}
}
}