Working on users view, added infrastructure lib

This commit is contained in:
2020-08-18 21:59:10 +02:00
parent 697886730e
commit 8fcd1c4c44
28 changed files with 184 additions and 99 deletions

View File

@ -0,0 +1,24 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace UserService.Infrastructure.DataModels
{
public abstract class Node : ICloneable
{
public int Id { get; set; }
[Required] public string CommonName { get; set; } = null!;
public string? Description { get; set; }
public ICollection<Node> Children { get; set; } = new List<Node>();
public Node? Parent { get; set; } //Parent
public int? ParentId { get; set; }
public override string ToString() => CommonName;
public int Level => Parent?.Level + 1 ?? 0;
/// <inheritdoc />
public virtual object Clone() => MemberwiseClone();
}
}