If I have a class like this


public class Booking : IBooking { public IDBRepository DBRepository { get; set; }
public void Purchase(int Amount, string ProductName, string ProductNumber) { TransactionData transactionData = new TransactionData {amount = Amount, productname = ProductName, productnumber = ProductNumber};
}
}
How do I save transactionData in DB using IDBRepository?
What is IDBRepository?
It’s an interface meant to implement a dummy dbrepository
C# devs
null reference exceptions

source