CLR types
Your entities describe the domain: services, people, projects, devices and their data.
GORM keeps graph structure explicit. A node is a domain entity, an edge is a typed relationship, and traversal expresses how a query moves through that topology.
Your entities describe the domain: services, people, projects, devices and their data.
Types opt into graph identity and relationships. Direction and edge type become queryable facts.
GORM translates graph intent to node tables, edge tables, predicates and SQL Server Graph MATCH expressions.
A node participates in graph relationships while keeping ordinary scalar properties. Id is the default identity convention.
public sealed class ServiceNode : Node
{
public string Name { get; set; } = string.Empty;
public ServiceState State { get; set; }
public string? Region { get; set; }
}Edges can have identity and properties of their own. This is useful when the relationship itself carries semantics such as priority, role, weight or provenance.
public sealed class DependsOnEdge : Edge
{
public DependencyKind Kind { get; set; }
public bool IsCritical { get; set; }
}For api -(DependsOn)-> database, outgoing traversal from api returns dependencies; incoming traversal from database returns dependents.
context.Set<ServiceNode>()
.Where(x => x.Id == apiId)
.Outgoing<DependsOnEdge, ServiceNode>()context.Set<ServiceNode>()
.Where(x => x.Id == databaseId)
.Incoming<DependsOnEdge, ServiceNode>()Traversal answers a path question. Include answers an object-materialization question. They are related but intentionally different tools.
A graph unit of work may contain scalar node changes, edge-property changes, new connections and disconnections. GORM treats those as explicit persistence work instead of hiding them behind collection manipulation.
Node modifiedScalar state changed.Edge modifiedRelationship metadata changed.ConnectA new topology relation is created.DisconnectAn existing topology relation is removed.Historical inspection is only useful if node history and edge history can be reasoned about together. Point-in-time graph queries should reconstruct what was connected at that moment.
var snapshot = await context.Set<ServiceNode>()
.AsOf(incidentStartedAt)
.ToListAsync();The in-memory execution path exists for deterministic tests. SQL Server Graph remains the production persistence semantics that provider-level integration tests must validate.
Never use a passing in-memory test as proof that provider-specific SQL translation, concurrency or temporal behavior is correct.