public decimal CalculateShippingCost(string zip, decimal weight) { var zone = _zipCodeRepo.GetZoneByZip(zip); var shippingCost = _shippingCostRepo.GetShippingCosts().Where(x => x.Zone == zone && x.Weight == weight).FirstOrDefault(); if (shippingCost == null) { throw new Exception($"Invalid weight of {weight} to this zip {zip}"); } return(shippingCost.Cost); }