public ItemList<FileOperationResult> MarkAsRead(AuthContext authContext, TenantManager tenantManager, IEnumerable<JsonElement> folderIds, IEnumerable<JsonElement> fileIds)
 {
     var tenant = tenantManager.GetCurrentTenant();
     var op1 = new FileMarkAsReadOperation<int>(ServiceProvider, new FileMarkAsReadOperationData<int>(folderIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), fileIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), tenant));
     var op2 = new FileMarkAsReadOperation<string>(ServiceProvider, new FileMarkAsReadOperationData<string>(folderIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), fileIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), tenant));
     var op = new FileMarkAsReadOperation(ServiceProvider, op2, op1);
     return QueueTask(authContext, op);
 }
        public ItemList <FileOperationResult> MarkAsRead(Guid userId, Tenant tenant, IEnumerable <JsonElement> folderIds, IEnumerable <JsonElement> fileIds)
        {
            var op1 = new FileMarkAsReadOperation <int>(ServiceProvider, new FileMarkAsReadOperationData <int>(folderIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), fileIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), tenant));
            var op2 = new FileMarkAsReadOperation <string>(ServiceProvider, new FileMarkAsReadOperationData <string>(folderIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), fileIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), tenant));
            var op  = new FileMarkAsReadOperation(ServiceProvider, op2, op1);

            return(QueueTask(userId, op));
        }
Exemple #3
0
        public ItemList <FileOperationResult> MarkAsRead(AuthContext authContext, TenantManager tenantManager, IEnumerable <object> folderIds, IEnumerable <object> fileIds)
        {
            var tenant = tenantManager.GetCurrentTenant();
            var op1    = new FileMarkAsReadOperation <int>(ServiceProvider, new FileMarkAsReadOperationData <int>(folderIds.OfType <long>().Select(Convert.ToInt32), fileIds.OfType <long>().Select(Convert.ToInt32), tenant));
            var op2    = new FileMarkAsReadOperation <string>(ServiceProvider, new FileMarkAsReadOperationData <string>(folderIds, fileIds, tenant));
            var op     = new FileMarkAsReadOperation(ServiceProvider, op2, op1);

            return(QueueTask(authContext, op));
        }
Exemple #4
0
        public List <FileOperationResult> MarkAsRead(Guid userId, Tenant tenant, List <JsonElement> folderIds, List <JsonElement> fileIds)
        {
            var(folderIntIds, folderStringIds) = GetIds(folderIds);
            var(fileIntIds, fileStringIds)     = GetIds(fileIds);

            var op1 = new FileMarkAsReadOperation <int>(ServiceProvider, new FileMarkAsReadOperationData <int>(folderIntIds, fileIntIds, tenant));
            var op2 = new FileMarkAsReadOperation <string>(ServiceProvider, new FileMarkAsReadOperationData <string>(folderStringIds, fileStringIds, tenant));
            var op  = new FileMarkAsReadOperation(ServiceProvider, op2, op1);

            return(QueueTask(userId, op));
        }
        public ItemList <FileOperationResult> MarkAsRead(List <object> folderIds, List <object> fileIds)
        {
            var op = new FileMarkAsReadOperation(folderIds, fileIds);

            return(QueueTask(op));
        }
Exemple #6
0
        public ItemList <FileOperationResult> MarkAsRead(AuthContext authContext, TenantManager tenantManager, List <object> folderIds, List <object> fileIds)
        {
            var op = new FileMarkAsReadOperation(ServiceProvider, new FileMarkAsReadOperationData(folderIds, fileIds, tenantManager.GetCurrentTenant()));

            return(QueueTask(authContext, op));
        }
        public ItemList<FileOperationResult> MarkAsRead(ItemList<String> items)
        {
            if (items.Count == 0) return GetTasksStatuses();

            List<object> foldersId;
            List<object> filesId;
            ParseArrayItems(items, out foldersId, out filesId);

            var task = new FileMarkAsReadOperation(
                CoreContext.TenantManager.GetCurrentTenant(),
                foldersId,
                filesId
                );

            Tasks.Add(task);

            return GetTasksStatuses();
        }