Esempio n. 1
0
        public void RestrictionsWithOneItemConvertsSuccessfully()
        {
            RequestRestrictions list = new RequestRestrictions();

            list.Add("issuer_did", "YWpmwLpTjxxieBPUxztnXo");

            string json       = list.ToJson();
            string resultJson = "{\"restrictions\":{\"issuer_did\":\"YWpmwLpTjxxieBPUxztnXo\"}}";

            Assert.AreEqual(resultJson, json, $"RequestRestrictions was converted to {json}");
        }
Esempio n. 2
0
            async Task <IQueryable <IntellectualPropertyDto> > IAsyncRequestHandler <Query, IQueryable <IntellectualPropertyDto> > .Handle(Query message)
            {
                var roleStageIds = await RequestRestrictions.GetUserRoleStagesIds(_context, message.UserId);

                var requests       = _context.Requests.WherePermissions(message.UserId, roleStageIds);
                var contracts      = _context.Contracts;
                var protectionDocs = _context.ProtectionDocs.Include(pd => pd.CurrentWorkflow).ThenInclude(cw => cw.CurrentStage);

                var result = requests.ProjectTo <IntellectualPropertyDto>()
                             .Concat(contracts.ProjectTo <IntellectualPropertyDto>())
                             .Concat(protectionDocs.ProjectTo <IntellectualPropertyDto>());

                return(result);
            }