Using the Vidyano Manager

The Vidyano Manager is an important object. It is available at the service side and exposes a lot of functionality. Let’s see what information the Object Browser gives us:image

Let’s explain the most common uses:

  1. User operations: In a lot of applications, you want to give the users of the application the ability to create users. All the functionality to create users at runtime is exposed by the Vidyano Manager. Following operations are available:
    1. Creating users (with or without group)
    2. Deleting users
    3. Getting users
    4. Getting groups
    5. Getting current user (the user executing the request)

    It is important to use these methods to create users. Vidyano caches these entries very aggressively in order to speed up the service.

  2. Client information: Following client information can be accessed:
    1. Current Client Culture
    2. Current Culture
    3. Environment with easy Boolean based properties like IsDesktop, IsMobile and IsWeb
    4. Session: the current Session object (the object itself can be configured in the management part of Vidyano.
  3. Settings
  4. Translations


Now that the most common uses are explained, let’s see how to use this to execute various user operations. Please note that the Manager object lives in the Vidyano.Service.Repository namespace.

var newUser = Manager.Current.CreateNewUser("test", "test", "user");
var currentUser = Manager.Current.CurrentUser;
var allUsers = Manager.Current.GetUsers();
var group = Manager.Current.GetUserOrGroup("Group");