Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

implemented account detail and transactions#9

Open
MamtaNallaretnam wants to merge 1 commit intomasterfrom
user-info
Open

implemented account detail and transactions#9
MamtaNallaretnam wants to merge 1 commit intomasterfrom
user-info

Conversation

@MamtaNallaretnam
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Owner

@codebyrpp codebyrpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you have made the changes let me know, I'll handle the conflicts.

Comment thread Models/Account.cs
public DateTime Date { get; set; }
public TransactionType Type { get; set; }
public string Recipient { get; set; }
public decimal Amount { get; set; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this double type

Comment thread Models/Account.cs
public class Account
{
public string AccountNumber { get; set; }
public decimal Balance { get; set; }
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this double type

Comment on lines +12 to +14
string connectionString = "connectionString";

using (SqlConnection connection = new SqlConnection(connectionString))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only this parts you have to change by using the AppDbContext, the rest seems ok to me


namespace BankingSystem.DbOperations;

public List<Transaction> GetAccountTransactions(string accountNumber)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be

public class  TransactionRepository : ITransactionRepository

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make an interface for this class also,

public class  ITransactionRepository
{
    public List<Transaction> GetAccountTransactions(string accountNumber);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implement this class using an interface.
Check the comment I have made about the TransactionRepository.cs file.

Comment on lines +11 to +14
public TransactionController()
{
repository = new TransactionRepository();
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check you how to properly initialize the repository as I have done in the master branch.
You can see how it's done in most of the controllers.
Also, inorder to do so, you have a code line in the Program.cs file. Here's the part you have to check in that file.

services.AddScoped<IUserRepository, UserRepository>();
services.AddScoped<IAuthenticationService, AuthenticationService>();
services.AddScoped<IIndividualRepository, IndividualRepository>();
// Add you respository here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants