2012年3月21日星期三

Monster Beats StudioLINQ already 90000 years

LINQ already 90000 years, today for the first time.LINQ effect seems to be used to query.When it comes to query, naturally think of SQL, database and so on, but the addition of LINQ can deal with the database data, more main is used to handle string, array, XML object search.
When LINQ just came out, because they do not understand, feel very strange, the operation of the database had been fanatical architects package, to distinguish between a layer after layer, data layer, business logic layer, this layer, and so on,Monster Beats Dr Dre, now come to a LINQ, directly in the code in the operation of the database, it is not a lie?Not bucked the trend?It is human, science,Moncler Jackets, the fucking damn it harmony ah, so do not learn.
Recently, because of the pressure to find a job, so look, feel vision than past open some.Height decides the vision, technical decision thinking ah, know it after use, finally in the application of a back.
Application of scene: record the user's interest.We have a lot of options, for example, eat, drink, prostitution, gambling and so on,Dre Beats Headphones, in the page to check box (checkbox) to reflect, the user can select.
Display this page, naturally, this pile of options are to be output, the user previously selected, hit uppercut.Method: data a, slove, user selected data, string type, shaped like a 1-2-3: the number is ID, middle “ ” separate data two, ctlist, List< > struct options, struLove / / custom structure, used for carrying the query results of elements.
Not the structure can not be.{public int Id; public string Name; public bool IsMyLove;} … … string [] arlove = slove. Split ('-'); / / shaped like a 1-2-3 string into an array.Ctlist is a > List<.
I model LINQ is combined with arlove and ctlist, find out the results of./ / Legend of the LINQ var CT in ctlist join setCt = from love in arlove on ct.ID.ToString (equals love into) GJ from subct in GJ.
DefaultIfEmpty () select new struLove {Id = ct.ID,Monster Beats Studio, Name = ct.Name, IsMyLove = (subct = = null? False: true)}; / / legend the end of the LINQ this.cblDefault.Items.Clear (); / / cblDefault < ASP: CheckBoxList > foreach (VaR V in controls setCt) {ListItem item = new ListItem (v.
Name, v.Id.ToString; item.Selected = v.IsMyLove ()); / / the user previously selected to hit line this.cblDefault.Items.Add (item);} it also used left join DefaultIfEmpty ().Or not, one with a high starting point, ha ha.
If no LINQ, certainly not what can not, two nested loops, the user selected data by comparison with options.PASCAL previously, a collection of this type, and later in other languages are not found.After a LINQ,Christian Louboutin Outlet, feeling set functions easier.
Related articles:

没有评论:

发表评论