Last post Jun 30, 2010 06:26 AM by firstname.lastname@example.org
Jun 28, 2010 02:43 PM|nisarkhan|LINK
know whats is happening and why its throwing an error (it does not find GetBrokenRules method because its List) but the reason i posted this question here is to ask for a better design, can anybody guide me here please?
i am working on Facilities class (List..../Building/Floor)
Error 3 'System.Collections.Generic.List' does not contain a definition for 'GetBrokenRules' and no extension method 'GetBrokenRules' accepting a first argument of type 'System.Collections.Generic.List' could be found (are you missing a using directive or
an assembly reference?)
error on >>> else if (Campus.GetBrokenRules().Count > 0)
is there any better way to desing my GetBrokenRules() ?
Jun 29, 2010 02:02 AM|aquarius17|LINK
I think you need to write Facilities.GetBrokenRules().Count insted of
Jun 30, 2010 06:26 AMemail@example.com|LINK
Campus is a list of entites so you need to check whether any of them have a broken rule something like:
else if (Campus.Any(camp => camp.GetBrokenRules().Count >0))
then you will need to iterate through the collection and pick up any broken rules.