public override T Convert <T, U>(U entity) { List <PolicyOwner> policyOwners = entity as List <PolicyOwner>; if (policyOwners == null) { return(default(T)); } List <BO.Common.PolicyOwner> boPolicyOwners = new List <BO.Common.PolicyOwner>(); foreach (var eachOwnerType in policyOwners) { BO.Common.PolicyOwner boPOwner = new BO.Common.PolicyOwner(); boPOwner.ID = eachOwnerType.Id; boPOwner.DisplayText = eachOwnerType.DisplayText; boPOwner.IsDeleted = eachOwnerType.IsDeleted; boPolicyOwners.Add(boPOwner); } return((T)(object)boPolicyOwners); }
public override object Get(int id) { var acc = _context.PolicyOwners.Where(p => p.Id == id && (p.IsDeleted.HasValue == false || p.IsDeleted == false)).FirstOrDefault <PolicyOwner>(); if (acc == null) { return(new BO.ErrorObject { ErrorMessage = "No record found.", errorObject = "", ErrorLevel = ErrorLevel.Error }); } BO.Common.PolicyOwner acc_ = ObjectConvert <BO.Common.PolicyOwner, PolicyOwner>(acc); return((object)acc_); }
public override T ObjectConvert <T, U>(U entity) { PolicyOwner policyOwner = entity as PolicyOwner; if (policyOwner == null) { return(default(T)); } BO.Common.PolicyOwner boPOwner = new BO.Common.PolicyOwner(); boPOwner.ID = policyOwner.Id; boPOwner.DisplayText = policyOwner.DisplayText; boPOwner.IsDeleted = policyOwner.IsDeleted; return((T)(object)boPOwner); }