I have a query regarding C# list.
I have two different types (account and accountDescriptionHistory) of lists. accountID and accountdescription two column present in both the list.
var account = new List<Account>();
var accountDescriptionHistory = new List<AccountDescriptionHistory>();
Now, I want to prepare a result list based on below conditions.
- If accountID match, Pick a accountdescription from accountDescriptionHistory list.
- Result list should be type of List();
Class definition
public class Account
{
/// <summary>
/// The account number
/// </summary>
public virtual string AccountNumber { get; set; }
/// <summary>
/// The account's description
/// </summary>
public virtual string Description { get; set; }
}
Account Description class :
public class AccountDescriptionHistory : EntityModel<AccountDescriptionHistory>
{
#region Public Properties
/// <summary>
/// The account description of an account that is valid for a specific date range
/// </summary>
public virtual string AccountDescription { get; set; }
/// <summary>
/// The account this AccountDescriptionHistory is associated with.
/// </summary>
public virtual Account Account { get; set; }
}