Entity
class from a symbolic algebra library:Looks awesome. Is simple. Very enjoyable. Let's see more!
Multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines
Entity
class from a symbolic algebra library:I offer a solution to one beautiful task — writing code that outputs its text is valid for interpreters and compilers of different languages and is correctly executed when reversing its sources.
Not so long ago I learned about code that can be both interpreted in PHP and compiled to Java: PhpJava.java. As it turned out, this idea is not new: code which is valid for several compilers or interpreters is called a polyglot. It is possible to write such code because of the peculiarities of processing strings and comments in different interpreters or compilers.
One of the very common questions I am getting from .NET
community is how to configure and use the tree structures in EF Core
. This story is one of the possible ways to do it.
The common tree structures are file tree, categories hierarchy, and so on. Let it be folders tree for example. The entity class will be a Folder
:
public class Folder
{
public Guid Id { get; set; }
public string Name { get; set; }
public Folder Parent { get; set; }
public Guid? ParentId { get; set; }
public ICollection<Folder> SubFolders { get; } = new List<Folder>();
}