示例#1
0
        /// <summary>
        /// Sets platform self links for the data element.
        /// </summary>
        /// <param name="storageHostAndBase">The host and base path for platform storage. E.g. 'at22.altinn.cloud/storage/api/v1/'. Must end with '/'.</param>
        /// <param name="instanceOwnerPartyId">The instance owner party id.</param>
        public void SetPlatformSelfLinks(string storageHostAndBase, int instanceOwnerPartyId)
        {
            if (SelfLinks == null)
            {
                SelfLinks = new ResourceLinks();
            }

            SelfLinks.Platform = $"https://platform.{storageHostAndBase}instances/{instanceOwnerPartyId}/{InstanceGuid}/data/{Id}";
        }
示例#2
0
        /// <summary>
        /// Sets platform self links for the instance.
        /// </summary>
        /// <param name="storageHostAndBase">The host and base path for platform storage. E.g. 'at22.altinn.cloud/storage/api/v1/'. Must end with '/'.</param>
        public void SetPlatformSelfLinks(string storageHostAndBase)
        {
            if (SelfLinks == null)
            {
                SelfLinks = new ResourceLinks();
            }

            SelfLinks.Platform = $"https://platform.{storageHostAndBase}instances/{this.Id}";

            if (Data != null)
            {
                foreach (DataElement element in Data)
                {
                    element.SetPlatformSelfLinks(storageHostAndBase, int.Parse(this.InstanceOwner.PartyId));
                }
            }
        }