コード例 #1
0
        public GroupModule(ICommandDispatcher commandDispatcher,
                           IGroupStorage groupStorage,
                           IValidatorResolver validatorResolver)
            : base(commandDispatcher, validatorResolver, modulePath: "groups")
        {
            Get("{id}", async args => await Fetch <GetGroup, Group>
                    (async x => await groupStorage.GetAsync(x.Id)).HandleAsync());

            Get("", async args => await FetchCollection <BrowseGroups, Group>
                    (async x => await groupStorage.BrowseAsync(x))
                .MapTo(x => new BasicGroup
            {
                Id             = x.Id,
                OrganizationId = x.OrganizationId,
                Name           = x.Name,
                Codename       = x.Codename,
                IsPublic       = x.IsPublic,
                State          = x.State,
                CreatedAt      = x.CreatedAt,
                MembersCount   = x.Members?.Count ?? 0
            }).HandleAsync());

            Post("", async args => await For <CreateGroup>()
                 .SetResourceId(x => x.GroupId)
                 .OnSuccessAccepted("groups/{0}")
                 .DispatchAsync());

            Post("{groupId}/members", async args => await ForModerator <AddMemberToGroup>()
                 .OnSuccessAccepted("groups/{0}")
                 .DispatchAsync());
        }
コード例 #2
0
 public GroupClient(IWebSocketClientStorage <TService> _socketClientStorage, IGroupStorage <TService> _groupStorage, IEventBusProxy _eventBusProxy, ILogger <GroupClient <TService> > _logger)
 {
     socketClientStorage = _socketClientStorage;
     groupStorage        = _groupStorage;
     eventBusProxy       = _eventBusProxy;
     RequestPath         = TenantPathCache.GetByType(typeof(TService));
     logger = _logger;
 }
コード例 #3
0
 public GroupLogic(IGroupStorage groupStorage)
 {
     _groupStorage = groupStorage;
 }
コード例 #4
0
 public StudentsController(IGroupStorage storage)
 {
     _storage = storage;
 }
コード例 #5
0
 /// <summary>
 /// Initializes an instance of this class
 /// </summary>
 /// <param name="controllerStorage">reference to the <see cref="IControllerStorage"/>, where all controllers are stored persistently</param>
 /// <param name="groupStorage">reference to the <see cref="IGroupStorage"/>, where all groups are stored persistently</param>
 /// <param name="ledStorage">reference to the <see cref="ILedStorage"/>, where all LEDs are stored persistently</param>
 public ControllerHandler(IControllerStorage controllerStorage, IGroupStorage groupStorage, ILedStorage ledStorage)
 {
     _controllerStorage = controllerStorage;
     _ledStorage        = ledStorage;
     _groupStorage      = groupStorage;
 }
コード例 #6
0
ファイル: GroupService.cs プロジェクト: kovavka/HSEvents
 public GroupService(IGroupStorage groupStorage)
 {
     this.groupStorage = groupStorage;
 }
コード例 #7
0
 public GroupLogic(IGroupStorage groupStorage)
 {
     this.groupStorage = groupStorage;
 }
コード例 #8
0
 /// <summary>
 /// Initializes an instance of this class
 /// </summary>
 /// <param name="groupStorage">reference to the <see cref="IGroupStorage"/> where all groups are stored persistently</param>
 /// <param name="ledStorage">reference to the <see cref="ILedStorage"/>  where all groups are stored</param>
 public GroupHandler(IGroupStorage groupStorage, ILedStorage ledStorage)
 {
     _groupStorage = groupStorage;
     _ledStorage   = ledStorage;
 }