Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - why does Enumerable.Except returns DISTINCT items? -


having spent on hour debugging bug in our code in end turned out enumerable.except method didn't know about:

var ilist = new[] { 1, 1, 1, 1 }; var ilist2 = enumerable.empty<int>(); ilist.except(ilist2); // returns { 1 } opposed { 1, 1, 1, 1 } 

or more generally:

var ilist3 = new[] { 1 }; var ilist4 = new[] { 1, 1, 2, 2, 3 }; ilist4.except(ilist3); // returns { 2, 3 } opposed { 2, 2, 3 } 

looking @ msdn page:

this method returns elements in first not appear in second. not return elements in second not appear in first.

i in cases this:

var ilist = new[] { 1, 1, 1, 1 }; var ilist2 = new[] { 1 }; ilist.except(ilist2); // returns empty array 

you empty array because every element in first array 'appears' in second , therefore should removed.

but why distinct instances of other items not appear in second array? what's rationale behind behaviour?

i cannot sure why decided way. however, i'll give shot.

msdn describes except this:

produces set difference of 2 sequences using default equality comparer compare values.

a set described this:

a set collection of distinct objects, considered object in own right


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -