init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.Ellenorzo.Domain.VN.Interfaces;
|
||||
using Kreta.Ellenorzo.Domain.VN.Logic;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.UniqueIdentifier
|
||||
{
|
||||
[Serializable]
|
||||
public class AdatszotarUid : IReadonlyUidRaw, IEqualityComparer<AdatszotarUid>
|
||||
{
|
||||
public AdatszotarUid(int id, string nev)
|
||||
{
|
||||
Id = id;
|
||||
Nev = nev;
|
||||
UidRaw = UidLogic.Concat(id, nev);
|
||||
}
|
||||
|
||||
public AdatszotarUid(string uidRaw)
|
||||
{
|
||||
var compositeKeyElements = UidLogic.GetCompositeKeyElements(uidRaw);
|
||||
Id = int.TryParse(compositeKeyElements[0], out int result) ? result : 0; //HACK DevKornél: Lehetnek kivételek
|
||||
Nev = compositeKeyElements[1];
|
||||
UidRaw = uidRaw;
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string Nev { get; private set; }
|
||||
|
||||
public string UidRaw { get; private set; }
|
||||
|
||||
public bool Equals(AdatszotarUid x, AdatszotarUid y) => x == y || x.UidRaw == y.UidRaw;
|
||||
|
||||
public int GetHashCode(AdatszotarUid obj) => obj.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue