Open tpluscode opened 10 years ago
Additionally it could be possible to declare an Id
property. If present it would be used instead of the generated blank node identified.
var entity = context.Load<IPerson>("some URI");
entity.Mother = new {
Id = new Uri("the mother's id"),
Name = "Theresa"
};
The question is how should the Name property be treated? After all it is possible that an entity already exists for the given Uri. Should the supplied values replace whatever values the already existed.
Lastly the IEntityContext
could be extended to enable creating new entities in a concise way.
dynamic myself = new {
Id = "http://example.org/about#me",
Name = "Tomasz",
LastName = "Pluskiewicz"
};
context.Add<IPerson>(myself);
Similarly to my previous comment it remains to be decided what should happen if the entity already exists.
It would be very handy to use anonymous objects to create entities, especially ones with a blank id. Currently a blank node id must be explicitely created
Here's how this could work instead
Internally a new blank identitifier would be generated for the anonymous object and each property would be translated to the destination type. In this case the properties would have to match those of
IAddress
.