示例#1
0
 public static void Log(this LoanBase loan, string msg, DbContext context)
 {
     if (loan != null)
     {
         WriteLog($"{Environment.NewLine}Loan '{msg}' -- state = {context.Entry(loan).State} -- id = {loan.Id}");
         loan?.Lender.Log(msg, context);
         loan?.LenderContact.Log(msg, context);
     }
     else
     {
         WriteLog($"{Environment.NewLine}Loan '{msg}' -- null");
     }
 }
示例#2
0
 public static void LoanGraphStateShouldBe(this DbContext context, LoanBase loan, Microsoft.EntityFrameworkCore.EntityState state)
 {
     context.StateShouldBe(loan, state);
     context.StateShouldBe(loan.Lender, state);
     context.StateShouldBe(loan.LenderContact, state);
 }