public decimal CalculateLocalCourierFee() { using (FreeMarketEntities db = new FreeMarketEntities()) { decimal totalWeight = GetTotalWeightOfOrder(); if (totalWeight == 0) { return(0); } else { return((decimal)db.CalculateLocalDeliveryFee(totalWeight, Order.OrderNumber).FirstOrDefault()); } } }