Skip to content

Instantly share code, notes, and snippets.

View brendan-nobadthing's full-sized avatar
🤔

Brendan Richards brendan-nobadthing

🤔
View GitHub Profile
@brendan-nobadthing
brendan-nobadthing / data.json
Created June 2, 2023 01:21
sample data as generasted by bogus
{
"id": "d8a36555-5427-463f-961a-2dab9ad68160",
"UserId": "faf154e6-39be-42b6-3d7f-700c76a2d59c",
"OrgId": "259879f3-cb10-c222-d06f-6ca4b4bc9d73",
"ProductId": "950dad62-7f6a-db6c-294d-90b85315e815",
"EventType": 2,
"User": {
"UserId": "faf154e6-39be-42b6-3d7f-700c76a2d59c",
"OrgId": "259879f3-cb10-c222-d06f-6ca4b4bc9d73",
"FirstName": "Oliver",
@brendan-nobadthing
brendan-nobadthing / users.cs
Created June 2, 2023 01:23
Bogus code to create test users
private IList<User> BuildUsers()
{
var orgFaker = new Faker<User>("en_AU")
.RuleFor(x => x.UserId, f => f.Random.Guid())
.RuleFor(x => x.OrgId, f => f.Random.ListItem(Organisations).OrgId)
.RuleFor(x => x.FirstName, f => f.Name.FirstName())
.RuleFor(x => x.LastName, f => f.Name.LastName())
.RuleFor(x => x.Address, f => f.Address.FullAddress())
.RuleFor(x => x.State, f => f.Address.State())
.RuleFor(x => x.Dob, f => f.Date.PastDateOnly(70, new DateOnly(2010,1,1)));
@brendan-nobadthing
brendan-nobadthing / program.cs
Created June 2, 2023 01:24
CosmosDB BulkExecution
var serviceProvider = new ServiceCollection()
.AddSingleton(new CosmosClient(
config["CosmosConnectionString"],
new CosmosClientOptions
{
AllowBulkExecution = true,
ApplicationName = "CosmosPartitionsTest",
ConnectionMode = ConnectionMode.Direct,
EnableContentResponseOnWrite = false
})