IUniqueObject - Aghyad-Khlefawi/Coddee GitHub Wiki

This interface defines a get only property called GetKey which is used to indicate the ID or a primary key for the object. This property is used in the edit or delete operations or any other common operation that required to select a single object.

C# Example:

In this example the Person class is using a property called ID as its primary key

public class Person:IUniqueObject<int>
{
    public int ID { get; set; }
    public string FirstName { get; set; }
    public int GetKey { get { return ID; } }
}

Implementing this interface allows other function to be used

var list = new List<Person>();
var pseron = new Person {ID = 1, FirstName = "Aghyad"};

list.Update(OperationType.Add, pseron);
list.Update(OperationType.Edit, pseron);
list.Update(OperationType.Delete, pseron);
⚠️ **GitHub.com Fallback** ⚠️