jaduff / LabLog

Software for recording physical users of computers in a lab environment.
MIT License
0 stars 1 forks source link

How do you handle event creation for non-root entities? #30

Closed jaduff closed 6 years ago

jaduff commented 6 years ago

Root entity creation is a static class public static School Create(string name, Action<ILabEvent> eventHandler) because there isn't an object to bind it to. But for child entities (lets take Room as a child of School)- if the user is adding a new room, when they press submit, should the controller instantiate a new School, and replay all its events before calling the AddRoom(room) method to get an event returned to save in the database? Is there a less intensive way of handling it?

simonjduff commented 6 years ago

Replay the whole thing. You said room names are unique, how can you check without replaying them all?