LotSizingDataModel.Core 2.0.1
Core domain model, shared abstractions and XML-serializable entities.
Loading...
Searching...
No Matches
IdentifiedEntity.cs
Go to the documentation of this file.
1using System;
2using System.Xml.Serialization;
3
5
6/// <summary>
7/// Base class for model entities that have both
8/// a numerical identifier and a name.
9/// </summary>
10[Serializable]
11[XmlType(TypeName = "identifiedEntity")]
12public abstract class IdentifiedEntity : NamedEntity
13{
14 private int _id;
15
16 /// <summary>
17 /// Initializes a new instance of the
18 /// <see cref="IdentifiedEntity"/> class.
19 /// </summary>
20 protected IdentifiedEntity()
21 {
22 }
23
24 /// <summary>
25 /// Gets or sets the numerical identifier of the entity.
26 /// </summary>
27 [XmlAttribute("id")]
28 public int Id
29 {
30 get => _id;
31 set => SetProperty(ref _id, value); // Notifies property change if value differs
32 }
33}
int Id
Gets or sets the numerical identifier of the entity.
IdentifiedEntity()
Initializes a new instance of the IdentifiedEntity class.
NamedEntity()
Initializes a new instance of the NamedEntity class.