Quantix
Quantix
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
thank you for the advice!
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
is there any documentation on this
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
but in terms of the db thing say you had MarketService you'd have a MarketService db on the same db server like postgres
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
is that what you would do?
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
i suppose I could have one big asp.net project for each of the services
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
so for k8s for example u can have these micro services across multiple regions auto restart
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
i believe the main appeal of micro services is redundency so that if one goes down the others remain up but is that actually viable? It'll be quite a big solution
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
i'm quite new to all these structures but I know they're quite opinionated so i'd like to hear how you'd set it up
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
They all share the same DB are you saying I should make individual dbs for each?
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
i don't think i'd set it up like GPT told me but rather like how the aspire sample works
18 replies
CC#
Created by Quantix on 1/11/2025 in #help
"Correct" way of setting up DB for Aspire.NET MicroServices following CA
The GPT is telling me to have 1 DatabaseInitializer that takes in multiple DbContexts and loops through them running EnsureCreated
public class DatabaseInitializer
{
private readonly IEnumerable<DbContext> _dbContexts;

public DatabaseInitializer(IEnumerable<DbContext> dbContexts)
{
_dbContexts = dbContexts;
}

public void Initialize()
{
foreach (var context in _dbContexts)
{
// Ensure the database is created
context.Database.EnsureCreated();

// Apply migrations
context.Database.Migrate();
}
}
}
public class DatabaseInitializer
{
private readonly IEnumerable<DbContext> _dbContexts;

public DatabaseInitializer(IEnumerable<DbContext> dbContexts)
{
_dbContexts = dbContexts;
}

public void Initialize()
{
foreach (var context in _dbContexts)
{
// Ensure the database is created
context.Database.EnsureCreated();

// Apply migrations
context.Database.Migrate();
}
}
}
can't tell if it's trying to gaslight me but maybe it's alright? I'd get running migrate on each one but not EnsureCreated, surely that only needs to be once
18 replies
NNuxt
Created by Dark_Mift on 1/2/2025 in #❓・help
TS false property not exists message (TS not detecting type in template)
i'm assuming that he's looping through the array on line 6 of the template and the category variable he gets out is the individual ProductData type which is also an array of the type he actually wants which contains the category_name
9 replies
NNuxt
Created by Dark_Mift on 1/2/2025 in #❓・help
TS false property not exists message (TS not detecting type in template)
can you show the template and the signature for the ProductData type
9 replies