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