stevie
stevie
CC#
Created by stevie on 8/4/2023 in #help
❔ How to organize folder structure in .NET with HotChocolate 13
Here is what I'm doing:
C# public class AccountMutations
{
public async Task<AddAccountPayload> AddAccountAsync(
AddAccountInput input,
[Service] DataContext context)
{
var account = new Account
{

FirstName = input.FirstName,
SecondName = input.SecondName,
UserId = input.UserId
};

context.Accounts.Add(account);
await context.SaveChangesAsync();
return new AddAccountPayload(account);
}
}
C# public class AccountMutations
{
public async Task<AddAccountPayload> AddAccountAsync(
AddAccountInput input,
[Service] DataContext context)
{
var account = new Account
{

FirstName = input.FirstName,
SecondName = input.SecondName,
UserId = input.UserId
};

context.Accounts.Add(account);
await context.SaveChangesAsync();
return new AddAccountPayload(account);
}
}
4 replies