public async Task SendAddedChildToCollectionEvent(Collection child, Collection parent) { var eventProps = new Dictionary <string, object> { { "Parent", parent.ToDictionary() }, { "Child", child.ToDictionary() } }; var theEvent = new HiarcEvent(ADDED_CHILD_TO_COLLECTION, eventProps); await this.SendEvent(theEvent); }
public async Task SendAddedUserToGroupEvent(User user, Group group) { var eventProps = new Dictionary <string, object> { { "User", user.ToDictionary() }, { "Group", group.ToDictionary() } }; var theEvent = new HiarcEvent(ADDED_USER_TO_GROUP, eventProps); await this.SendEvent(theEvent); }
public async Task SendNewVersionOfFileCreatedEvent(File file, FileVersion fileVersion) { var eventProps = new Dictionary <string, object> { { "File", file.ToDictionary() }, { "FileVersion", fileVersion.ToDictionary() } }; var theEvent = new HiarcEvent(NEW_VERSION_OF_FILE_CREATED, eventProps); await this.SendEvent(theEvent); }
public async Task SendAddedFileToCollectionEvent(File file, Collection collection) { var eventProps = new Dictionary <string, object> { { "File", file.ToDictionary() }, { "Collection", collection.ToDictionary() } }; var theEvent = new HiarcEvent(ADDED_FILE_TO_COLLECTION, eventProps); await this.SendEvent(theEvent); }
public async Task SendAddedGroupToCollectionEvent(Group group, Collection collection) { var eventProps = new Dictionary <string, object> { { "Group", group.ToDictionary() }, { "Collection", collection.ToDictionary() } }; var theEvent = new HiarcEvent(ADDED_GROUP_TO_COLLECTION, eventProps); await this.SendEvent(theEvent); }
private async Task SendEntityEvent <T>(string eventName, T entity, Dictionary <string, object> additionalProps = null) where T : Entity { var eventProps = entity.ToDictionary(); if (additionalProps != null) { foreach (var item in additionalProps) { eventProps.Add(item.Key, item.Value); } } var theEvent = new HiarcEvent(eventName, eventProps); await this.SendEvent(theEvent); }