public Double convertToCommonUnitValue(Double nValue, Int64 ixUnit) { if (_unitofmeasurementconversionsRepository.Index().Where(x => x.ixUnitOfMeasurementFrom == ixUnit).Any()) { return(_unitofmeasurementconversionsRepository.Index().Where(x => x.ixUnitOfMeasurementFrom == ixUnit).Select(x => x.nMultiplier).FirstOrDefault() * nValue); } else { return(0); } }
public IQueryable <UnitOfMeasurementConversions> Index() => _unitofmeasurementconversionsRepository.Index();