public override T Convert <T, U>(U entity) { List <InsuranceType> insuranceTypes = entity as List <InsuranceType>; if (insuranceTypes == null) { return(default(T)); } List <BO.Common.InsuranceType> boInsuranceType = new List <BO.Common.InsuranceType>(); foreach (var eachInsuranceType in insuranceTypes) { BO.Common.InsuranceType boInsurType = new BO.Common.InsuranceType(); boInsurType.ID = eachInsuranceType.Id; boInsurType.InsuranceTypeText = eachInsuranceType.InsuranceTypeText; boInsurType.IsDeleted = eachInsuranceType.IsDeleted; boInsuranceType.Add(boInsurType); } return((T)(object)boInsuranceType); }
public override object Get(int id) { var acc = _context.InsuranceTypes.Where(p => p.Id == id && (p.IsDeleted.HasValue == false || p.IsDeleted == false)).FirstOrDefault <InsuranceType>(); if (acc == null) { return(new BO.ErrorObject { ErrorMessage = "No record found.", errorObject = "", ErrorLevel = ErrorLevel.Error }); } BO.Common.InsuranceType acc_ = ObjectConvert <BO.Common.InsuranceType, InsuranceType>(acc); return((object)acc_); }
public override T ObjectConvert <T, U>(U entity) { InsuranceType insuranceType = entity as InsuranceType; if (insuranceType == null) { return(default(T)); } BO.Common.InsuranceType boInsurType = new BO.Common.InsuranceType(); boInsurType.ID = insuranceType.Id; boInsurType.InsuranceTypeText = insuranceType.InsuranceTypeText; boInsurType.IsDeleted = insuranceType.IsDeleted; return((T)(object)boInsurType); }