/// <summary> /// Get list of policies from the Policy class and format it for the UI /// </summary> /// <returns>List of <see cref="PolicyResponse"/></returns> public List <PolicyResponse> GetPolicyResponse() { List <Policy> policies = _policy.GetAllPolicies(); return(policies.ConvertAll(x => new PolicyResponse(_dbContext, _policy) { PolicyNumber = x.PolicyNumber, PolicyExpirationDate = x.PolicyExpirationDate, PolicyEffectiveDate = x.PolicyEffectiveDate, PrimaryInsuredName = x.PrimaryInsuredName })); }