Copied to clipboard

Flag this post as spam?

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


  • Kenny Burns 172 posts 302 karma points
    Jun 08, 2020 @ 16:40
    Kenny Burns
    0

    uSync - ImportAll

    Hello,

    In previous versions of uSync you used to be able to do something similar like:

    var uSyncBackOffice = uSyncBackOfficeContext.Instance; var actions = uSyncBackOffice.ImportAll()

    Can you point me in the right direction of how you would go about this in uSync8 please?

    Many thanks,

    Kenny

  • Kevin Jump 1753 posts 11263 karma points MVP 4x c-trib
    Jun 08, 2020 @ 16:46
    Kevin Jump
    100

    Hi,

    With v8 you have to do this with dependency injection but you can do it. you need to load the uSyncService and then you can access Import/Report/etc...

    e.g

    public class MyService
    {
        private readonly uSyncService _uSyncService;
        public MyService(uSyncService uSyncService)
        {
            _uSyncService = uSyncService;
        }
    
        public void FullImport()
        {
            var settings = Current.Configs.uSync();
            _uSyncService.Import(settings.RootFolder, false, default(SyncHandlerOptions));
        }
    }
    
  • Kenny Burns 172 posts 302 karma points
    Jun 09, 2020 @ 13:34
    Kenny Burns
    0

    Thanks Kevin!

Please Sign in or register to post replies

Write your reply to:

Draft