URL
XMLFILE
df36be82-2b61-4c35-bb66-201aca2d0a55 0.01 Oh miners might hold her work in the developer and platform group in Microsoft in the UK and this is the first of a series of shorts recast about a 10.01 new technology that comes as part of a deal done in version 3 that technology is called into entities was a quick look at the technology year and then subsequently 20.01 as will looking a little bit more depth just as a way of introducing a dude on the version 3 eventually if we look at what we have today which 30.01 is a delight to we have provided a particular data stores they come with the man s connections data readers and later adapters that are specialised in that particular store 40.01 Argos and I had to speak to the school where the store might be sequel or Oracle something like that in version 3 will be doing it is adding the 50.01 ability for an application developer to build a conceptual model of this door some other programme necessarily against the tables and the views and the useful procedures that exist in the 60.01 Or we can do it we can abstract ourselves away from that building entity relationship model essentially conceptual model of what a store should look like in the way that we 70.01 ought to programme against it and we have a mapping technology which takes a conceptual model and maps it back at you read right manner to the real store and the 80.01 hope is that this will not end up just being sequel server specific this has been designed to be pluggable such the other store providers like Oracle and someone can come 90.01 on board and plug in their providers to use anti framework is well drivers that you get this conceptual data model that application can programme against rather than having to deal 100.01 with the vividly logical model of the store itself which is not something you would want to surface into application on top of that we get a new and idiotic provider 110.00999999999999 is called the entity provider and at that level essentially sure querying through the entity provider it comes with its own own sequel like language which will entity sequel and 120.01 At that level if you re querying with entity sequel against a conceptual model you are completely abstracted from the underlying store or is potentially well and 130.01 that would mean that you could quite easily perhaps move from one school to another without a changing your country queries or anything like that on top 140.01 of that entity provided that there is a new thing which is what looking at heel into entities and into entities essentially an object relational mapping API 150.01 so an API that knows how to go between the conceptual model in this case net types of memory and battles are fought between those two things 160.01 saw good enough at that conceptual model add the ability to program that an object relational mapping Manor and are finally on top of that M API 170.01 we have link so you can program against that without using and he wanted to work you have the ability to use language integrated query to manipulate these entities 180.01 Come from this conceptual model thriller nutshell at the top we got link and object relational mapping API onto a conceptual model which is itself mapped onto the real 190.01 underlying store and that s what you re going to get with entity framework in a given version 3 is the only official duties as may be to I 200.01 ve also got the tattoo of the entity framework technology installed and I ve also got the first community technical preview of the tooling for the entity framework installed 210.01 to let it go ahead and make a new project in an edition ago for a single project will go for our windows console application using C Sharp Consul 220.01 application three is just fine and essential listening to this application is only too about a solution Explorer and has a new item into the project is very important 230.01 to realise that the stuff I do in this session is one way of doing things and many more ways of doing what were about to do here 240.01 Animal season goes on such concessions were trying keep it relatively shallow for doing here so we go through an avenue item in the latest issues in 250.01 a field on the entity datamodel I will call this model Northwind as road use Northwind database here eventually I may get a wizard at this point 260.01 asking me what I want and regenerate my model from a database and I did use Northwind so avoided a connection to that I m going to 270.01 save the connection string in my own configuration file on another dialogue promptly for what is it you want to bring into your model are not going 280.01 to bring in skilled procedures and are they going to bring you my customers my orders and my order details table to get nursery entities brought into 290.01 this project without anger away and it doesn t work even gives some time that diagnostics were hung it up a place at one of 300.01 With Ambrose and making opener is easier next file EDS and 70 datamodel and what you get on this design surface here are the entities that it 310.01 is rotting 60 customers orders in escrow of the will have all the details and essentially weighed anti framework works is that we have conceptual model we 320.01 have the model of glass door that is the actual physical database that were dealing with and we have and mapping between the conceptual and the actual 330.01 stuff that exists in the store in this session will delete it well alone when of the changes mapping at all his life a one to one 340.01 mapping between the store and conceptual model that is close father I go so if I bring up my programme code will see that behind the scenes 350.01 essentially the model is also generating a bunch of code for us if we look at that specific using that there is a class of vehicle north and entities 360.01 Tregarth programme again is so much as pop back to code and has collapsed and is using statement to get rid of thisjust takes 370.01 place on the screen and a little ahead and use one of those Northwind entities and the call was a context because it is 380.01 kind of a complex was finally got a using spam s agony one of those and anyone to queries and data so lets say 390.01 and we want to get data perhaps some kind of summary powers to specific customers and they threaten how much nothing are shielded from 400.01 the database so noticed the other context to have properties like customers have properties like orders and we have properties on order details of 410.01 programme against the tragic weary let s say a turn for each order so I will even context orders that were the ones for customers 420.01 Who live Somerset old customers notice how we navigate across from an order to its customer just in a natural object oriented way and ignore the wood 430.01 customers should really customer I haven t renamed in my model oh customers city and at Staples Berlin might also ask for it customers or Surrey owed 440.01 it at 60 then so the living bill at their ownership and then I select a new record here from this and animal prints that record is 450.01 a contact name is that oh customers contact name lets put into that all so you re driving to our already vote the old variety as possible 460.01 into there and the total amount that they ordered on that particular order so we can say and total equals and this is going to be oh 470.01 the order details belong to some something saw some of you to provide a land here to give us a son is also ordered the 480.01 That produces a detailed stock price times on and does not quantity in a vicious assault of everything they ordered but he wrote around that result sets was 490.01 very and preach the enquiry that is right that the console and because we re using an anonymous type here is a projection we will get the nice 500.01 to strain a city which opened at the plans for has gone and run this program and hopefully this is the result of ex kidnapper against a database 510.01 to conceive that this particular person made these particular orders in the total ordered on these things of this way I worked out it is these values here 520.01 so using a cogeneration talk we brought into our environment a conceptual model which is one to one match with the actual database we could change that mapping 530.01 but we wanted that such an animal programming is using his natural object oriented techniques in order to get the data that will from the database 540.01 So things like using a quality operators here things are navigating relationships in this way and a really nice man properties likely now to do this I ll provide a lander 550.01 here in order to that now it s important to realise that what we do here as we define a query on what we do here is the executed query and 560.01 when we come to execute the query any framework is smart enough to capture all this intensely and generate in our particular tasty sequel from but in other databases cases events 570.01 differently might be PLC cool something like that at the point where there was support from other databases comply now if we go and is run as good as to show 580.01 how is working fresco rerun we will see that in order to do this query I go back to a sequel profile and I ve got running in the background here 590.01 because either in fact a direct acute that we went ahead in an excuse to query and I would say at the moment in the framework that he sequel that 600.01 That is not particularly pretty and I believe that this going to be improved running beat it at this point but you can see that essentially went ahead and executed clauses to 610.01 find the Berlin customers you can see here were doing the summer in the database you can see here were multiplying in a price by quantity in the database saw the work 620.01 will be expressed in see shout it could have an over here it is essential translated through into the database and in that case I m using sequel server but there is 630.01 the potential in the frame of using other databases as and when us and my command line does not think that when I went to regret in this video will come back 640.01 and revisit in later videos but just to give you the impression that time we can only do queries would be wrong of course we can also do the other part of 650.01 club operations using link to entities to let it go ahead and do her an updated something here is change the glutamate as simple as you say we will 660.01 Get all the customers and the database was so from sea in confident customers will get the ones that live in the UK and will select those customers and I 670.01 was a freak of those things and let a safe reach customer see in that query let s change the country to be in Britain rather than UK and at 680.01 that point we make these changes they happen in memory that they don t have to happen in the database they only happen in the database and I will recall 690.01 context save changes and we are surviving through which another explain this video will be coming at a house in a subsequent video but we make those changes live in 700.01 the database at this point and the framework will go and generate a sequel in our case in order to make the sings live in the database lets disco and 710.01 Monaco will will reset profile as we can see what it actually does a runner code will look sadly broke it is just make that an assignment rather than a test in Antwerp 720.01 To as it ago in a code and if you look at what happened in the database will see a whole bunch of updates going to the database changing 730.01 the country of these various customers to Great Britain and we soon are having a number of times for the customers that we just affected so not only can 740.01 we query data we can also change data and again is important to remember that the programme against a conceptual model here which is acting match to theis a 750.01 lot of flexibility and a mapping where does the summer as a senior idiot at that version 3 will come with a single entity framework diver Dave Rose shipping 760.01 this that I making this video it will certainly be late and it was 50 000 a night and allowed you to build a conceptual model from an underlying 770.01 schema in a real database the advantage of doing that if it means that you can program against the entities you want to have represented your real entities in your programme 780.01 Than the actual and normalise tables and and use of your store so at the conceptual model level you abstracted from the real tables and views of your database you 790.01 can versus have one entity in your model the concentrate for tables in a database even model inheritance in your model which you can t really model in the database 800.01 you have written over relationships and navigating them in the model that you don t really have the database so that abstract you from the schema of your store in 810.01 programme against the real tables and views any more and it can also strategy from the language of your store because you re not programming in for instance to use 820.01 equal animal service to level the distraction there that they give you a lot of database independence is also probable frameworks are well received Microsoft will should support the sequel 830.01 circle but we have hope and expect that other vendors will come on board and ship support for other database and that seems a very promising at the time of recording video 840.01 On top of that entity framework comes linked to entities are now true of this video is about this is an object relational mapping API so we use mapping 850.01 technology is to brained things from that conceptual model which existed relational in July into an p net world by mapping of the net taxonomy can program against the 860.01 data in that conceptual model and the rich were using gun at times and tabernacle to get link and language query syntax and query expressions and so on allows 870.01 as the programme s conceptual model in a really in with the rich way that such a video for follow up and looking topics are much more depth but 880.01 it is to give a good overview is to how this looks on how you started and what you can do it in a nutshell will come back and 890.01 revisit things so where can you go of your more information on topics is seen here at the final into the Link Centre on amnesty ends as a whole section 900.01 Language integrated query at their I would also recommend going to be a good on net team locks 910.01 on the link is up there on the screen for a kid of their and those that optional 920.01 a really interesting information on that blog site is a good place to keep in touch with what 930.01 s going on honesty framework if you got specific questions that something is run as video feel free 940.01 to mail me my e mail address is there on screen and other than that of the friendly 950.01 session useful and I would hope to catch up with you again in the future
Monday, February 25, 2008
LINQ to Entities - Intro (Metadata, Querying, Updating)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment