private static int GetSpecialsQuantity(CalculateTrolleyTotalCommand.RequestTrolley.TrolleyProductQuantity productQuantity, CalculateTrolleyTotalCommand.RequestTrolley.TrolleySpecial sps) { try { return(sps.Quantities.FirstOrDefault(x => x.Name == productQuantity.Name).Quantity); } catch { return(0); } }
private static bool SpecialsIncorrectlySetup(CalculateTrolleyTotalCommand.RequestTrolley.TrolleySpecial sps) { return(sps == null || sps.Total <= 0); }