Facts

The core unit of data in Jinaga is a fact. A fact is an immutable record of an event, decision, or state change. Let's start simple. When the user logs into your application, that's a fact.

(User user, UserProfile profile) = await j.Login();
%0 Gs+Fo0xO04hUAteaPwrHZDmyovTwr7asnKsBrkRf3HE3M9nYIj4Sk7ZhR8YK5uMq1SMHPrQohtQNwo9B7whK0w== Jinaga.User publicKey --- TEST USER ---

Each fact has a type (Jinaga.User in this case) and a set of properties (publicKey for this example).

The Jinaga.User type is defined in the Jinaga library. But, of course, you can define your own types. Write a record and use the FactType attribute to define a type.

[FactType("Construction.Project")]
public record Project(User creator, Guid id);

To create an instance of this fact, call j.Fact. This method is asynchronous because it will save the fact to the local store and notify the replicator to synchronize it with other clients.

Project projectA = await j.Fact(new Project(user, Guid.NewGuid()));
%0 Gs+Fo0xO04hUAteaPwrHZDmyovTwr7asnKsBrkRf3HE3M9nYIj4Sk7ZhR8YK5uMq1SMHPrQohtQNwo9B7whK0w== Jinaga.User publicKey --- TEST USER --- PYaXGGp+ksHg101LgyF/pB/OBQsixEhWZ9RDW9wxdwX/sVFWgyhpOZROgi4Gttdz1lWJ5Un0pJPJ5MvXEk1TCQ== Construction.Project id 52eb9df8-7b1c-43d4-9... PYaXGGp+ksHg101LgyF/pB/OBQsixEhWZ9RDW9wxdwX/sVFWgyhpOZROgi4Gttdz1lWJ5Un0pJPJ5MvXEk1TCQ==->Gs+Fo0xO04hUAteaPwrHZDmyovTwr7asnKsBrkRf3HE3M9nYIj4Sk7ZhR8YK5uMq1SMHPrQohtQNwo9B7whK0w== creator

Continue With

Predecessors

Jinaga is a product of Jinaga LLC.

Michael L Perry, President