This is fairly simple method. I use entity framework to get some data and then check some values in a if statement. However right now the method is marked with red.
This is my method:
private bool IsSoleInProduction(long? shoeLastID) { if (shoeLastID == null) { MessageBox.Show(Resources.ERROR_SAVE, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } ISoleService soleService = UnityDependencyResolver.Instance.GetService<ISoleService>(); List<Sole> entity = soleService.All().Where(s => s.ShoeLastID == shoeLastID).ToList(); if (entity.Count() != 0) { foreach (var items in entity) { if (items.Status == 20) { return true; } else { return false; } } } else { return false; } } What am I missing?