Hi guys,
Well, around my time making picture frames (recently) I have managed to move-forward the demo app for Cologne, on LINQ and Entity Framework, with WPF/XAML and data binding. The results of the development are even amazing to me - he who designed it !
Entity Framework 6 takes so much of the mundane 'boring' bits out of database work that it almost makes me smile.
First of all lets see the finished input screen for a user to create and save a new Order for a selected customer :-
Note that all the screen data is 'data bound' as public properties in the ViewModel. The zero entries in the cells of the DataGrid show that the EF6 system has not yet saved the new order, as it will eventually allocate IDs when it does.
We have made the code as clean as it should be for an MVVM approach, and the code behind looks like this :-
For anyone who has had to use ADO.NET in the past years, and do all the database work the hard way in code, they/you will not believe how little needs to be done to save a business entity (like the customer's order) - check this out :-
All we need do is use the objects of the bound public properties to add a new order into the selected customer's order list - no need to worry about identities and how they are saved, we just need to deal with IDs that already exist.
Oh! we also need to see how simple it is to launch the ViewModel / View pair in the first place :-
Yes, we do need to have a bunch of public properties within our ViewModel for data binding, at is the secret to getting all this stuff to work so simply ;-0) Here are the private fields which match the PPs on a one to one basis :-
Once we click the green 'save' button the new order data is sent to the back-end data SQL server and persisted - then as if by magic the EF and WPF system show the newly allocated IDs for order and order lines - see below :-
Now we can use some of the other features to check-out what we have just done. The red button for Orders in the Entities group box shows this below :-
And the OrderLines can bee seen with the cyan button, a click to launch a RelayCommand :-
Finally we can look at the customer form and look into an appropriately nested combo box (drop list) - all this as we have to do little in code except get the Entity mapping correct in the first place - check below :-
Enough of this magic for now, in another post I may show how easy it was to save each new order line.
Hope this interests a few of you guys.
Best Regards,
Phil.
Wales, UK.
This Entity stuff just works ! Great with LINQ ...
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
This Entity stuff just works ! Great with LINQ ...
Hi guys,
I tried to attach a short video clip of me running the demo LINQ / Entity app - BUT - it can't be attached as it is an disallowed file format.
The video is here:
Please can yo try to acquire this and then run it ? Let me know of either success or failure.
Good Luck and fingers crossed,
Phil.
I tried to attach a short video clip of me running the demo LINQ / Entity app - BUT - it can't be attached as it is an disallowed file format.
The video is here:
Please can yo try to acquire this and then run it ? Let me know of either success or failure.
Good Luck and fingers crossed,
Phil.
This Entity stuff just works ! Great with LINQ ...
Works - albeit i miss some sound ![Wink ;)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_wink.gif)
![Wink ;)](https://dt9qzg9h465rt.cloudfront.net/phpBB3/images/smilies/icon_e_wink.gif)
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
This Entity stuff just works ! Great with LINQ ...
Sorry Karl,
Office PC does not have a microphone, and I unfortunately don't speak German other than a few words and phrases ;-0)
Or is it the tip-tap and clitter-clatter of the keyboard that you miss ?
Regards, and thanks for testing,
Phil.
P.S. it surprised me how the link to the OneDrive file actually got the MP4 file to run as a video with just one click. Great this OneDrive technology.
Office PC does not have a microphone, and I unfortunately don't speak German other than a few words and phrases ;-0)
Or is it the tip-tap and clitter-clatter of the keyboard that you miss ?
Regards, and thanks for testing,
Phil.
P.S. it surprised me how the link to the OneDrive file actually got the MP4 file to run as a video with just one click. Great this OneDrive technology.
This Entity stuff just works ! Great with LINQ ...
Nope - but, as my son would say, some "stylish" background music is a must ;->dr philip h. hepburn wrote:...Or is it the tip-tap and clitter-clatter of the keyboard that you miss ?
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
This Entity stuff just works ! Great with LINQ ...
Phil,
Robert
No magic. I added the mp4 extension as an allowed extension, downloaded your MP4, acttached it to your message and inserted the document in the message.dr philip h. hepburn wrote:Sorry Karl,
it surprised me how the link to the OneDrive file actually got the MP4 file to run as a video with just one click. Great this OneDrive technology.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
- Phil Hepburn
- Posts: 743
- Joined: Sun Sep 11, 2016 2:16 pm
This Entity stuff just works ! Great with LINQ ...
Thanks Robert,
That is why (therefore) that is clicks and runs "like Magic! "
End result is great at this end.
Don't panic, I won't over-use it ;-0)
X# and VS 2017 working very well together here in Newport, UK.
Have a nice weekend, one and all.
Phil.
That is why (therefore) that is clicks and runs "like Magic! "
End result is great at this end.
Don't panic, I won't over-use it ;-0)
X# and VS 2017 working very well together here in Newport, UK.
Have a nice weekend, one and all.
Phil.