I want to push an element to an array inside another array inside a document using LINQ with latest MongoDb driver
here is the code:
public class Contract : BaseDocument
{
public ObjectId Id {get;set;}
...
public List<Payment> Payments {get;set;}
}
public class Payment : BaseDocument
{
public ObjectId Id {get;set;}
public double TotalPaymentAmount {get;set;}
public DateTime PaymentWorthDate {get;set;}
...
public List<PaymentTransaction> PaymentTransactions {get;set;}
}
public class PaymentTransaction
{
public double AmountPaid {get;set;}
public DateTime TransactionDateTime {get;set;}
}
So how to push new PaymentTransaction to a specific Payment in a particular Contract using 'LINQ Expression' ?
Thanks!