Blazor Revealed by Peter Himschoot

Blazor Revealed by Peter Himschoot

Author:Peter Himschoot
Language: eng
Format: epub
ISBN: 9781484243435
Publisher: Apress


private DebitService ds;

private CreditService cs;

private BankRepository br;

public TransferService(

DebitService ds, CreditService cs, BankRepository br)

{

this.ds = ds;

this.cs = cs;

this.br = br;

}

public Transfer(decimal amount, Account from, Account to) {

ds.Debit(from, amount);

cs.Credit(to, amount);

br.Commit();

}

}

Listing 4-15Implementing a TransferService

If all three services use the same instance of BankRepository, then this should work fine, as in Figure 4-4.

Figure 4-4Using a scoped repository



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.