public static async Task <TResource[]> CreateResourcesAsync <TResource>(this FhirClient client, int count) where TResource : Resource, new() { TResource[] resources = new TResource[count]; for (int i = 0; i < resources.Length; i++) { TResource resource = new TResource(); resources[i] = await client.CreateAsync(resource); } return(resources); }
public static async Task <TResource[]> CreateResourcesAsync <TResource>(this FhirClient client, params Action <TResource>[] resourceCustomizer) where TResource : Resource, new() { TResource[] resources = new TResource[resourceCustomizer.Length]; for (int i = 0; i < resources.Length; i++) { TResource resource = new TResource(); resourceCustomizer[i](resource); resources[i] = await client.CreateAsync(resource); } return(resources); }
public static async Task <TResource[]> CreateResourcesAsync <TResource>(this FhirClient client, int count, string tag) where TResource : Resource, new() { TResource[] resources = new TResource[count]; for (int i = 0; i < resources.Length; i++) { TResource resource = new TResource(); resource.Meta = new Meta() { Tag = new List <Coding> { new Coding("testTag", tag), }, }; using var response = await client.CreateAsync(resource); resources[i] = response; } return(resources); }