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;
|
||||
using Kreta.Enums.ManualEnums;
|
||||
|
||||
namespace Kreta.Ellenorzo.Domain.VN.UniqueIdentifier
|
||||
{
|
||||
public class ErtekelesUid : IReadonlyUidRaw, IEqualityComparer<ErtekelesUid>
|
||||
{
|
||||
public ErtekelesUid(int id, ErtekelesJelleg jelleg)
|
||||
{
|
||||
Id = id;
|
||||
Jelleg = jelleg;
|
||||
UidRaw = UidLogic.Concat(id, jelleg);
|
||||
}
|
||||
|
||||
public ErtekelesUid(string uidRaw)
|
||||
{
|
||||
var compositeKeyElements = UidLogic.GetCompositeKeyElements(uidRaw);
|
||||
Id = int.Parse(compositeKeyElements[0]);
|
||||
Jelleg = (ErtekelesJelleg)Enum.Parse(typeof(ErtekelesJelleg), compositeKeyElements[1]);
|
||||
UidRaw = uidRaw;
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
public string UidRaw { get; private set; }
|
||||
|
||||
public ErtekelesJelleg Jelleg { get; set; }
|
||||
|
||||
public bool Equals(ErtekelesUid x, ErtekelesUid y) => x == y || (x.UidRaw == y.UidRaw && x.Jelleg == y.Jelleg);
|
||||
|
||||
public int GetHashCode(ErtekelesUid obj) => obj.UidRaw.GetHashCode();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue