I have two objects Customer_policy and policy_maturity.
public class Customer_policy
{
public virtual String policy_no { get; set; }
public virtual DateTime maturity_date { get; set; }
public virtual Boolean matured_status { get; set; }
}
public class Policy_maturity
{
public virtual string policy_no { get; set; }
public virtual string customer_id { get; set; }
public virtual float maturity_amt { get; set; }
public virtual string policy_type { get; set; }
public virtual DateTime pay_date { get; set; }
}
When a customer creates a policy Customer_policy is getting populated but Policy_maturity should remain empty(which I have already done). When a policy matures I want to insert a row in Policy_maturity and update matured_status field of the corresponding Customer_policy. What type of mapping should I do so that inserting and update gets accomplished by hitting the database only one time ??? Thanx for your suggestions.