C
C#Cool4funny

Help With hints on how can i make multipull accounts using like arrays or something similar to array

i just want an easy way this is my code GIve me hitns only
No description
No description
No description
C
Cool4funny17d ago
without <> too
C
Cool4funny17d ago
A
Angius17d ago
Any reason you want to avoid generics? I assume that's what you mean by "without <>"
C
Cool4funny17d ago
i have no idea whats this i gtg
A
Angius17d ago
Well, in any case, you already seem to have a bank account class So just have an array or a list of them Boom, you have multiple
C
Cool4funny16d ago
can you show me an example? since ik arrays have a limit on how much you want inside And One Doesent or with vectors like show me the diffs with both
A
Angius16d ago
Yes, List<T> is dynamically-sized, and T[] (array) has a preset size And how would you use a list, for example? Well, quite simple
var accounts = new List<BankAccount> {
new BankAccount(),
new BankAccount(),
new BankAccount(),
};
var accounts = new List<BankAccount> {
new BankAccount(),
new BankAccount(),
new BankAccount(),
};
C
Cool4funny16d ago
Can you explain it whats its doing? like whats var?
L
leowest16d ago
var is a compile time variable that the compiler changes it to the right hand when compiled. So essentially it is List<BankAccount> for example:
var str = "test"; // var is string
var num = 10; // var is int
var accounts = new List<BankAccount>(); // var is List<BankAccount>
var str = "test"; // var is string
var num = 10; // var is int
var accounts = new List<BankAccount>(); // var is List<BankAccount>
C
Cool4funny15d ago
is it possible to make it without var?
A
Angius15d ago
Sure
List<BankAccount> accounts = new List<BankAccount> {
new BankAccount(),
new BankAccount(),
new BankAccount(),
};
List<BankAccount> accounts = new List<BankAccount> {
new BankAccount(),
new BankAccount(),
new BankAccount(),
};
Want results from more Discord servers?
Add your server
More Posts
System.InvalidOperationException: Unable to resolve service for type 'MovieApi_backend.database.Contwhen i connect my application to database postgresql and when i hit the post req getting error candata update error in c# sqlI want to change the password of the user in the database. I get the password changed warning on theASP Core 8 - Custom 404 HandlingI have a few scenarios where I need to show a different kind of view and a bit of different logic deAdd suffix to version without it showing up as a prereleaseI'm writing a lib that wraps a bunch of external GRPC APIs and exposes them via the same interface. Help refactor serviceHi! I have data of many `Station` models. Their information updates every ~60 minutes. I need to sto✅ looking for help/contributorsDotmenu is a straightforward console menu library designed to streamline user interactions in consolHow to find relative file path for file inside of project?Dealing with a C# console application, I have a folder inside the project named Files and inside thaPassing parameters to overloaded constructorHow would I pass the texture2D variable to be handled in the second constructor. Obviously return doI am trying to store data in database using EF my code run fine but its not storing dataif (response.IsSuccessStatusCode) { var json = await resUsing ref for large data types.Hi, just looking for a little clarification on the *ref* keyword when passing data into a function. crud operations with blazor serverI have a backend that I built and now I want to use it with api calls. I created same model with bacminor glitch, player twitchingso i have a glitch where the player starts "twitching" when you walk beside a block or just on a blo✅ BackgroundWorker getting progressI have a winform applications and with this I have put a ProgressBar on it. I was manually changing My tech stack, what to focus now?- .NET Core - Entity Framework Core (Code First) - MVC - Web API - Identity and JWT - Mediator & CQRBuild Issue due to $(Platform) valueWe are facing build issue when we try to build .net project in custom project configuration, like DePFX certificate for signing the application packageI am trying to use a certificate from azure key vault, but it says that it is invalid or another reaInheritance best practice: test Type of subclass or use enum?See attched UML. Just wondering what the best practice is? Is it better to test the Type of BaseEffeC# - Oracle DataBase Converting the Date (Oracle) to a c# DateTime PropertyHow can I replace TO_TIMESTAMP in my select query with the format my c# code uses? I have a class wiAdding Multitenancy through Finbuckel in the single tenant Dotnet applicationHey I was just implementing the Multitenancy to my existing single tenant dotnet application where oI need help with Deployment LogicSo let's say I have 10 servers (already setup with a load balancer and all that stuff) which all run