Exemple #1
0
        private async Task UpdateOrAddContentInfo(UploadFolder request, IAbsoluteDirectoryPath path)
        {
            var cl = await ContentLinkContext.GetFolderLink().ConfigureAwait(false);

            var l           = cl.Infos.FirstOrDefault(x => x.Path.Equals(path));
            var contentInfo = new ContentInfo(request.UserId, request.GameId, request.ContentId);

            if (l != null)
            {
                l.ContentInfo = contentInfo;
            }
            else
            {
                cl.Infos.Add(new FolderInfo(path, contentInfo));
            }
        }
Exemple #2
0
 public async Task <List <FolderInfo> > Handle(GetFolders request)
 =>
 (await ContentLinkContext.GetFolderLink().ConfigureAwait(false)).Infos.Where(
     x => request.Folders.Contains(x.Path.ToString())).ToList();
Exemple #3
0
 public async Task <IAbsoluteDirectoryPath> Handle(GetUploadFolder request)
 =>
 (await ContentLinkContext.GetFolderLink().ConfigureAwait(false)).Infos.FirstOrDefault(
     x => x.ContentInfo.ContentId == request.ContentId)?
 .Path;