Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • NDDT 68 posts 240 karma points c-trib
    Feb 05, 2016 @ 15:46
    NDDT
    0

    SaveAndPublishWithStatus async

    Can I use the SaveAndPublishWithStatus-Function asynchron?

    I'm trying to use it in a method but I always get a NullReferenceException.

  • NDDT 68 posts 240 karma points c-trib
    Feb 19, 2016 @ 14:52
    NDDT
    0

    Im trying something like this (minimal exampel)

            foreach (var elem in e.SavedEntities.Where(n => n.ContentType.Alias.Equals("repository") && n.IsNewEntity()))
            {
                new System.Threading.Tasks.Task(() => { asynchelper(sender, elem.Id); }).Start();
            }
    

    with this function

        private void asynchelper(IContentService sender, int pid)
        {
            IContent c = sender.CreateContent("Test", pid, "ordner");
            sender.SaveAndPublishWithStatus(c);
        }
    

    I get this error: enter image description here

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies