BankSystem7 0.2.6-beta
See the version list below for details.
dotnet add package BankSystem7 --version 0.2.6-beta
NuGet\Install-Package BankSystem7 -Version 0.2.6-beta
<PackageReference Include="BankSystem7" Version="0.2.6-beta" />
paket add BankSystem7 --version 0.2.6-beta
#r "nuget: BankSystem7, 0.2.6-beta"
// Install BankSystem7 as a Cake Addin #addin nuget:?package=BankSystem7&version=0.2.6-beta&prerelease // Install BankSystem7 as a Cake Tool #tool nuget:?package=BankSystem7&version=0.2.6-beta&prerelease
Bank system 7
This package was developed for common using and learning definite technology. It also let everybody to use bank system in its projects and change logic for your needs.
It's a beta version of library. Some exceptions can be weren't found.
Documentation
Structure of project
- Folder AppContext is folder where contain context classes for interaction with database without buisness logic.
- Folder Services contains 2 sub folders: Interfaces and Repositories.
- Folder Interfaces contains interfaces which describes structure of inherited classes.
- Folder Repositories is folder with all buisness logic of project. Only there simple developer has access.
How to interact with database?
Developer can interact with database using class BankServiceOptions that provides properties for a little configuration. Set connection string you can by set value to property Connection. Ensure create or delete database by setting value to properties EnsureCreated and EnsureDeleted.
Remember!
If you'll not change connection string to database in class BankServiceOptions or directly in repository classes program may don't work correctly. You can catch exception like "There isn't database which has been specified." because databases which was used in developing project may doesn't exist on your machine.
API documentation
AppContext
There are 2 classes context:
- BankContext - is responsible for handling database/tables with bank resources.
- BankAccountContext - is responsible for handling database/tables with banks accounts resources.
- CardContext - is responsible for handling database/tables with cards resources.
API BankContext
Methods:
public ExceptionModel CreateOperation(Operation operation,
OperationKind operationKind)
- creates transaction operation.public ExceptionModel DeleteOperation(Operation operation)
- delete transaction operationpublic ExceptionModel TakeCredit(BankAccount bankAccount, Credit credit)
- gives money to user which creditionals specified inCredit
.public ExceptionModel RepayCredit(BankAccount bankAccount, Credit credit)
- handles repaying credit.private ExceptionModel BankAccountWithdraw(Bank bank, Operation operation)
- withdraw money from bank's account.public ExceptionModel BankAccountWithdraw(BankAccount bankAccount, Bank bank, Operation operation)
- withdraw money from user bank account and accrual to bank's account.private ExceptionModel BankAccountAccrual(BankAccount bankAccount, Bank bank, Operation operation)
- accrual money to user bank account from bank's account.private ExceptionModel AddCredit(Credit credit)
- adds a new credit field to database and binds it with user.private ExceptionModel RemoveCredit(Credit credit)
- removes definite credit field from database.private StatusOperationCode StatusOperation(Operation operation, OperationKind operationKind)
- returns status of operation for next handling of operation.
Properties:
public DbSet<User> Users { get; set; }
- an instance of the tableUsers
in database.public DbSet<Bank> Banks { get; set; }
-an instance of the tableBanks
in database.public DbSet<Operation> Operations { get; set; }
- an instance of the tableOperations
in database.public DbSet<BankAccount> BankAccounts { get; set; }
- an instance of the tableBankAccounts
in database.public DbSet<Credit> Credits { get; set; }
- an instance of the tableCredits
in database.
API BankAccountContext
Properties:
public DbSet<Order> Orders { get; set; }
- an instance of the tableOrders
in database.public DbSet<BankAccount> BankAccounts { get; set; }
- an instance of the tableBankAccounts
in database. <br>
Services
Services are dividing on 2 sub-folders:
- Interfaces
- Repositories
Interfaces
Here located interfaces which describes behavior of inherited repo-classes.
- Interface
IRepository<T>
- parent interface from which will inherite other interfaces and repo-classes. Describes main logic and structure of the project. Methods:
ExceptionModel Create(T item);
- implements creating item and adding it in database.ExceptionModel Update(T item);
-implements updating item in database.ExceptionModel Delete(T item);
- implements deleting item from database.IEnumerable<T> All { get; }
- implements getting a sequence of the objects from database.T Get(Expression<Func<T, bool>> predicate);
- implements getting an object from database with func-condition.bool Exist(Expression<Func<T, bool>> predicate);
- implements checking exist object with in database func-condition.
Repositories
Repositories are implementation of various interfaces and working with context classes for interracting with database.
BankRepository
- implements interfaceIRepository<T>
for handling bank model, contains methods for accrual or withdraw money from bank account and bank.BankAccountRepository
- implements interfaceIRepository<T>
for handling bank account model and Transfer money method.CardRepository
- implements interfaceIRepository<T>
for handling card model and Transfer money method.UserRepository
- implements interfaceIRepository<T>
for handling user model.
When cause exception or error?
There are some points when you can catch an exception or error while using api of project:
- You use default connection string instead of Your. Can happen so that on Your machine won't database with name which was specified in default connection string.
- You change content of repositories or context class. If You change some of these You can get an error. Example:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.EnableSensitiveDataLogging();
optionsBuilder.UseSqlServer(queryConnection);
}
You'll write something like this
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.EnableSensitiveDataLogging();
optionsBuilder.UseSqlServer();
}
- You use methods incorrectly.
Example:
You want to delete operation therefore You have to use method
DeleteOperation(...)
but You use methodCreateOperation(...)
and of course You'll get an exception because methodCreateOperation(...)
has return typeExceptionModel
and it'll returnsExceptionModel.OperationFailed
because same operation already exist in the database which You are using.
Remember!
Always change connection string either directly in context class, repository classes or use class BankServiceOptions for configuration. In any situations when Your program, OS or something else was broken, only You is responsible for it. Please, be more intelligent. :>
Conclusion
Dowloading and next using this package is your respoinsible and only You decide use it or not. All exceptions and crashes of your projects is responsible on You. We was tested our product in many tests and have a conclusion in which says that all methods and logic of project are working correctly. So, we wish You luck.
Sincerely, hayako.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Microsoft.AspNetCore.Cryptography.KeyDerivation (>= 7.0.0-rc.1.22427.2)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.EntityFrameworkCore (>= 7.0.0-rc.1.22426.7)
- Microsoft.EntityFrameworkCore.SqlServer (>= 7.0.0-preview.7.22376.2)
- MongoDB.Driver (>= 2.17.1)
- MySql.EntityFrameworkCore (>= 6.0.4)
- Newtonsoft.Json (>= 13.0.2-beta2)
- Npgsql (>= 7.0.0-rc.1)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 7.0.0-rc.1)
- System.Data.HashFunction.Interfaces (>= 2.0.0)
- System.Data.HashFunction.Jenkins (>= 2.0.0)
-
net7.0
- Microsoft.AspNetCore.Cryptography.KeyDerivation (>= 7.0.0-rc.1.22427.2)
- Microsoft.AspNetCore.Http (>= 2.2.2)
- Microsoft.EntityFrameworkCore (>= 7.0.0-rc.1.22426.7)
- Microsoft.EntityFrameworkCore.SqlServer (>= 7.0.0-preview.7.22376.2)
- MongoDB.Driver (>= 2.17.1)
- MySql.EntityFrameworkCore (>= 6.0.4)
- Newtonsoft.Json (>= 13.0.2-beta2)
- Npgsql (>= 7.0.0-rc.1)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 7.0.0-rc.1)
- System.Data.HashFunction.Interfaces (>= 2.0.0)
- System.Data.HashFunction.Jenkins (>= 2.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BankSystem7:
Package | Downloads |
---|---|
Standart7
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
0.5.8 | 145 | 9/13/2023 | |
0.5.7 | 102 | 9/11/2023 | |
0.5.6 | 140 | 7/22/2023 | |
0.5.5 | 106 | 7/1/2023 | |
0.5.4 | 97 | 6/19/2023 | |
0.5.3 | 104 | 6/19/2023 | |
0.5.2 | 101 | 6/3/2023 | |
0.5.1 | 93 | 5/22/2023 | |
0.5.0 | 98 | 5/21/2023 | |
0.4.9 | 95 | 5/14/2023 | |
0.4.8 | 90 | 5/6/2023 | |
0.4.7 | 84 | 5/6/2023 | |
0.4.6 | 89 | 5/6/2023 | |
0.4.5 | 99 | 5/6/2023 | |
0.4.4 | 104 | 5/2/2023 | |
0.4.2 | 100 | 4/29/2023 | |
0.4.1 | 98 | 4/27/2023 | |
0.4.0 | 104 | 4/27/2023 | |
0.3.9 | 105 | 4/25/2023 | |
0.3.8 | 104 | 4/19/2023 | |
0.3.7 | 98 | 4/19/2023 | |
0.3.6-beta | 96 | 4/13/2023 | |
0.3.5-beta | 89 | 4/12/2023 | |
0.3.4-beta | 88 | 4/10/2023 | |
0.3.3-beta | 88 | 4/3/2023 | |
0.3.2-beta | 94 | 4/3/2023 | |
0.3.1-beta | 93 | 4/2/2023 | |
0.3.0-beta | 97 | 4/1/2023 | |
0.2.9-beta | 102 | 4/1/2023 | |
0.2.7-beta | 113 | 3/28/2023 | |
0.2.6-beta | 118 | 3/24/2023 | |
0.2.5-beta | 119 | 3/20/2023 | |
0.2.4-beta | 115 | 3/20/2023 | |
0.2.3-beta | 109 | 3/20/2023 | |
0.2.2-beta | 122 | 3/20/2023 | |
0.2.1-beta | 124 | 3/20/2023 | |
0.1.3-beta | 117 | 3/20/2023 | |
0.1.2-beta | 119 | 3/19/2023 | |
0.1.0-beta | 116 | 3/19/2023 |