public IEnumerable <PrivacyPolicyViewModel> Review([FromBody] PolicyReviewCommand command) { JObject user = string.IsNullOrEmpty(command.UserJsonData) ? new JObject() : JObject.Parse(command.UserJsonData); JObject resource = string.IsNullOrEmpty(command.ResourceJsonData) ? new JObject() : JObject.Parse(command.ResourceJsonData); JObject environment = string.IsNullOrEmpty(command.EnvironmentJsonData) ? new JObject() : JObject.Parse(command.EnvironmentJsonData); var relativePolicies = _privacyService.Review(user, resource, environment); var result = new List <PrivacyPolicyViewModel>(); foreach (var policy in relativePolicies) { result.Add(new PrivacyPolicyViewModel() { CollectionName = policy.CollectionName, Description = policy.Description, PolicyId = policy.Id, Target = FunctionUtility.Convert(policy.Target) }); } return(result); }