Esempio n. 1
0
 private static void FillInbox(Guid processId, Raven.Client.IDocumentSession session)
 {
     var newActors = Runtime.GetAllActorsForDirectCommandTransitions(processId);
     foreach (var newActor in newActors)
     {
         var newInboxItem = new WorkflowInbox() { IdentityId = newActor, ProcessId = processId };
         session.Store(newInboxItem);
     }
 }
Esempio n. 2
0
        public static Result<None> Delete(Raven.Client.IDocumentSession session, string feedId, string blogPostId)
        {
            try
            {
                var feed = session.Load<BlogFeed>(feedId);

                if (feed == null)
                    return None.False(new ArgumentException("Feed Id is not found"));

                var post = session.Load<BlogPost>(blogPostId);

                if (post == null)
                    return None.False(new ArgumentException("Blog Id is not found"));

                session.Delete(post);
                feed.MarkAsUpdated();
                session.Store(feed);
                session.SaveChanges();

                return None.True();
            }
            catch (Exception ex)
            {
                return None.False(ex);
            }
        }