1 00:00:00,540 --> 00:00:01,530 ‫Welcome back. 2 00:00:01,560 --> 00:00:06,450 ‫In this video, I'm going to give you a gentle introduction to Link. 3 00:00:06,450 --> 00:00:09,930 ‫And link is used to retrieving data from a data source. 4 00:00:09,930 --> 00:00:16,230 ‫And by using a link query operation, you can get data from different types of data sources, and that's 5 00:00:16,230 --> 00:00:19,740 ‫exactly what the power of link is all about. 6 00:00:19,740 --> 00:00:26,280 ‫So Array's database is XML files and many more sources are valid for a query operation. 7 00:00:26,760 --> 00:00:29,490 ‫Let's look at the three parts of a query operation. 8 00:00:29,490 --> 00:00:34,260 ‫So obtain a data source, create a query, execute the query. 9 00:00:34,260 --> 00:00:41,360 ‫So that's always the three steps that you need in order to actually get some data or adjust some data. 10 00:00:41,370 --> 00:00:46,860 ‫So example usage, you should print out the entries of a string array sorted by name. 11 00:00:47,010 --> 00:00:52,410 ‫So here we have an array called names and there is Berta, clause and Atom. 12 00:00:52,470 --> 00:00:57,000 ‫So the first step is our data source, which is our names string. 13 00:00:57,030 --> 00:00:59,490 ‫The second step is the query creation. 14 00:00:59,490 --> 00:01:07,320 ‫So we create this query called Var query equals from name in names, order by name, ascending select 15 00:01:07,320 --> 00:01:07,830 ‫name. 16 00:01:07,830 --> 00:01:15,090 ‫So we go through all the names, then we order them by ascending, which means we get them in an alphabetic 17 00:01:15,090 --> 00:01:18,210 ‫order and then we select name. 18 00:01:18,390 --> 00:01:25,770 ‫Now what we can do is we can go and create a query execution by using it for each loop where we go ahead 19 00:01:25,770 --> 00:01:31,770 ‫and run through every single element of the query and print it out onto the console. 20 00:01:31,770 --> 00:01:33,420 ‫So console, right line. 21 00:01:33,420 --> 00:01:38,100 ‫And then I so the output will be Adam, Roberta and Klaus. 22 00:01:38,100 --> 00:01:46,770 ‫So what we did here is we just reordered the entry of the data that we had and we didn't change the 23 00:01:46,770 --> 00:01:47,610 ‫string itself. 24 00:01:47,610 --> 00:01:53,160 ‫We just printed it in a different way for us, except usage. 25 00:01:53,160 --> 00:01:59,100 ‫You should print out the entries of an entire array sorted by their size, but ignore values that are 26 00:01:59,100 --> 00:02:00,420 ‫smaller than five. 27 00:02:00,420 --> 00:02:06,630 ‫So here, another one where you see the data source is this numbers array which contains four values 28 00:02:06,630 --> 00:02:13,350 ‫7513 and 125, and then of course the four as well, which does not fit our criteria. 29 00:02:13,350 --> 00:02:18,660 ‫So the query creation is as follows where query from number in numbers. 30 00:02:18,660 --> 00:02:25,350 ‫So we say, okay, we want to check every single number in numbers and we want to go ahead and only 31 00:02:25,350 --> 00:02:28,830 ‫use the numbers which are greater than five. 32 00:02:28,830 --> 00:02:33,810 ‫And we ordered them descending, which means we go from top to bottom. 33 00:02:33,810 --> 00:02:38,070 ‫So from the highest number to the lowest number, and then we select that number. 34 00:02:38,190 --> 00:02:40,290 ‫So what our four each two. 35 00:02:40,290 --> 00:02:47,010 ‫So our query execution will now give us is the output of 135, 75 and 13. 36 00:02:47,010 --> 00:02:54,240 ‫So four will not be included because it doesn't fit our criteria, which was where number creator five 37 00:02:54,240 --> 00:02:55,350 ‫So what you can see here. 38 00:02:56,860 --> 00:02:58,810 ‫Of course, you can make this a lot more complex. 39 00:02:58,810 --> 00:03:05,190 ‫You can get a lot more kinds of limits or filters onto your data. 40 00:03:05,200 --> 00:03:08,050 ‫And that's, of course, the power that we have here. 41 00:03:08,440 --> 00:03:14,440 ‫Now, this is a very, very gentle and basic explanation of what you can do with Link, but we only 42 00:03:14,440 --> 00:03:16,030 ‫looked at arrays. 43 00:03:16,060 --> 00:03:22,630 ‫Of course, you can also get the data from different data sources and Lync will behave the exact same 44 00:03:22,630 --> 00:03:22,960 ‫way. 45 00:03:22,960 --> 00:03:26,890 ‫And that's really the power of Lync because it doesn't care about the data source. 46 00:03:27,580 --> 00:03:29,830 ‫It can work with it either way. 47 00:03:29,830 --> 00:03:31,320 ‫So it can work with a race. 48 00:03:31,330 --> 00:03:34,690 ‫It can work with XML and it can work with databases. 49 00:03:34,690 --> 00:03:39,520 ‫And we're going to look into those in more detail, of course, in the following videos. 50 00:03:39,520 --> 00:03:40,770 ‫So I hope you enjoy it. 51 00:03:40,780 --> 00:03:47,440 ‫It's going to be a more advanced topic, but at the same time you're going to learn to really use the 52 00:03:47,440 --> 00:03:53,140 ‫skills that you have acquired so far at a very realistic or real life use. 53 00:03:53,140 --> 00:03:56,290 ‫So I hope you enjoy it and see you in the next video.