17 lines
498 B
C#
17 lines
498 B
C#
namespace InnovEnergy.API.DataModel;
|
|
|
|
public static class DataElementExtensions
|
|
{
|
|
public static IEnumerable<DataElement> GetChildren(this DataElement de)
|
|
{
|
|
return de switch
|
|
{
|
|
Folder f => f.Folders.Concat<DataElement>(f.Installations).Concat(f.Users),
|
|
Installation i => i.Users,
|
|
_ => Enumerable.Empty<DataElement>()
|
|
};
|
|
}
|
|
|
|
public static Path RelativePath(this DataElement root) => new Path(null, root);
|
|
|
|
} |