0% found this document useful (0 votes)
4 views

database

The document defines a banking system using Entity Framework Core, including a database context class 'MyAppDbContext' with DbSet properties for various entities such as Customer, Employee, Account, Loan, Deposit, VerifyCustomer, AppRole, and UserInfo. Each entity class includes properties with data annotations for validation and relationships, such as foreign keys. The structure supports functionalities related to customer management, account handling, loans, deposits, and user roles.

Uploaded by

RameshMajji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

database

The document defines a banking system using Entity Framework Core, including a database context class 'MyAppDbContext' with DbSet properties for various entities such as Customer, Employee, Account, Loan, Deposit, VerifyCustomer, AppRole, and UserInfo. Each entity class includes properties with data annotations for validation and relationships, such as foreign keys. The structure supports functionalities related to customer management, account handling, loans, deposits, and user roles.

Uploaded by

RameshMajji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

using Microsoft.

EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace banksystem1
{
public class MyAppDbContext : DbContext
{
public DbSet<Customer> Customers { get; set; }
public DbSet<Employee> Employees { get; set; }
public DbSet<Account> Accounts { get; set; }
public DbSet<Loan> Loans { get; set; }
public DbSet<Deposit> Deposits { get; set; }
public DbSet<VerifyCustomer> verifyCustomers { get; set; }
public DbSet<AppRole> appRoles { get; set; }
public DbSet<UserInfo> userInfos { get; set; }
public MyAppDbContext(DbContextOptions opts) : base(opts)
{

}
}
public class Customer
{
[Key]
public int Customer_ID { get; set; }
[Required]
public string Customer_Name { get; set; }
[Required]
public string Customer_Email { get; set; }
[Required]
public string Customer_Password { get; set; }
[Required]
public int Customer_Phone { get; set; }
[Required]
public DateTime Customer_DateOfBirth { get; set; }
[Required]
public int Customer_Aadhar_No { get; set; }
[Required]

public string Customer_Address { get; set; }


[Required]
public string Customer_Picture { get; set; }

public int IsVerfied { get; set; }

List<Account> cuts { get; set; }


}
public class Account
{
[Key]
public int Account_ID { get; set; }
[Required]
public int Customer_ID { get; set; }
[Required]
public int Account_Number { get; set; }
[Required]
public string Account_Type { get; set; }
[Required]
public int Balance { get; set; }

public string Account_Status { get; set; }

[ForeignKey("Customer_ID")]
public Customer accunt { get; set; }

}
public class Loan
{
[Key]
public int Loan_ID { get; set; }
[Required]
public int Customer_ID { get; set; }
[Required]
public int Account_ID { get; set; }
[Required]
public int Employee_ID { get; set; }
[Required]
public int Loan_Ammount { get; set; }
[Required]
public int Interest_Rate { get; set; }
[Required]
public int Durations { get; set; }
[Required]
public int Due_Ammount { get; set; }

[ForeignKey("Employee_ID")]
public Employee emp { get; set; }

}
public class Deposit
{
[Key]
public int Transactions_ID { get; set; }
[Required]
public int Customer_ID { get; set; }
[Required]
public int Account_ID { get; set; }
[Required]
public int Employee_ID { get; set; }
[Required]
public string CrediteOrDeposit { get; set; }
[Required]
public int Ammount { get; set; }

public string Transactions_Type { get; set; }

[ForeignKey("Employee_ID")]
public Employee emps { get; set; }

}
public class Employee
{
[Key]
public int Employee_ID { get; set; }
[Required]
public string Employee_Name { get; set; }
[Required]
public string Employee_Email { get; set; }
[Required]
public string Employee_Password { get; set; }
[Required]
public int Employee_Phone { get; set; }
[Required]
public string Employee_Address { get; set; }

List<Loan> Loanee { get; set; }


List<Deposit> depositee { get; set; }

}
public class VerifyCustomer
{
[Key]
public int VerifyCustomer_ID { get; set; }
[Required]
public int Customer_ID { get; set; }
}
public class AppRole
{
[Key]
public int Id { get; set; }
[Required]
public string RoleName { get; set; }
public List<UserInfo> UsersInRole { get; set; }
}
public class UserInfo
{
[Key]
public int UId { get; set; }
[Required]
public String UserName { get; set; }
[Required]
public String Password { get; set; }
public int RoleId { get; set; }
[ForeignKey("RoleId")]
public AppRole UserRoles { get; set; }

}
}

You might also like