init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Co.Enum;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V2.Model.CustomEnum
|
||||
{
|
||||
public class NaploEnum
|
||||
{
|
||||
public static implicit operator int(NaploEnum naploEnum) => naploEnum.Id;
|
||||
public static implicit operator int?(NaploEnum naploEnum) => naploEnum?.Id;
|
||||
|
||||
public int Id { get; set; }
|
||||
public string Nev { get; set; }
|
||||
private NaploEnum() { }
|
||||
public static NaploEnum Create<T>(NaploEnumCo<T> co) where T : struct, IConvertible
|
||||
{
|
||||
if (co == null)
|
||||
return null;
|
||||
return new NaploEnum
|
||||
{
|
||||
Id = co.Id,
|
||||
Nev = co.Nev
|
||||
};
|
||||
}
|
||||
public static NaploEnumCo<T> Create<T>(NaploEnum model) where T : struct, IConvertible
|
||||
{
|
||||
if (model == null)
|
||||
return null;
|
||||
return new NaploEnumCo<T>(model.Id);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Co.Enum;
|
||||
using Kreta.Naplo.Domain.V2.Model.Converter;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V2.Model.CustomEnum
|
||||
{
|
||||
public class NaploEnumList
|
||||
{
|
||||
public List<NaploEnumListItem> ElemLista { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns an NaploEnumList Instance that has been converted from NaploEnumListCO
|
||||
/// </summary>
|
||||
public static NaploEnumList Create<T>(NaploEnumListCo<T> co) where T : struct, IConvertible
|
||||
=> new NaploEnumList
|
||||
{
|
||||
ElemLista = co.ElemLista.ConvertAll(EnumConverter.CoToModel)
|
||||
};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Co.Enum;
|
||||
|
||||
namespace Kreta.Naplo.Domain.V2.Model.CustomEnum
|
||||
{
|
||||
public class NaploEnumListItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Nev { get; set; }
|
||||
|
||||
/// public string Leiras { get; set; }
|
||||
|
||||
public static implicit operator NaploEnumListItem(NaploEnumListItemCo co) => new NaploEnumListItem
|
||||
{
|
||||
Id = co.Id,
|
||||
/// TODO Nev = co.Nev
|
||||
Nev = co.Description /// TODO rename Leiras
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue