This is a .NET package for random text generation. Good for testing the responsivity of front-end applications to see the behaviour of the layouts, if it grows and decreases in the ideal proportion.
Package | Version | Downloads | Workflow |
---|---|---|---|
Bacon.Ipsum.API.Client | |||
Bacon.Ipsum.API.Client.DependencyInjection |
- GenerateSentenceAsync: Generate a text with a specific amount of sentences;
var response = await client.TextGenerator
.GenerateSentenceAsync(1)
.ConfigureAwait(false);
);
- GenerateParagraphAsync: Generate a text with a specific amount of paragraphs;
var response = await client.TextGenerator
.GenerateParagraphAsync(1)
.ConfigureAwait(false);
);
This Api integration is ver simple, there is no authentication/authorization requirements, you can use it with almost no configurations.
You can instanciate this client in three different ways:
- Using default configs (This uses the values inside the Configurations resource file):
var client = new BaconIpsumApiClient();
or by dependency injection:
services.AddBaconIpsumApiClient();
- Only configurating the API base url:
var client = new BaconIpsumApiClient(baseUrl);
or by dependency injection:
services.AddBaconIpsumApiClient(baseUrl);
- And setup manually all configurations with your preferences:
var configs = new BaconIpsumApiClientConfiguration
{
BaseUrl = baseUrl,
MaxTimeout = maxTimeOut,
ThrowOnAnyError = throwOnErrors,
StartWithLorem = true,
Type = TextContentType.MEAT_AND_FILLER
};
var client = new BaconIpsumApiClient(configs);
or by dependency injection:
var configs = new BaconIpsumApiClientConfiguration
{
BaseUrl = baseUrl,
MaxTimeout = maxTimeOut,
ThrowOnAnyError = throwOnErrors,
StartWithLorem = true,
Type = TextContentType.MEAT_AND_FILLER
};
services.AddBaconIpsumApiClient(configs);