Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying WCF Multi-layer Services Development with Entity Framework - Fourth Edition
  • Table Of Contents Toc
WCF Multi-layer Services Development with Entity Framework - Fourth Edition

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By : Mike Liu
4.2 (13)
close
close
WCF Multi-layer Services Development with Entity Framework - Fourth Edition

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

4.2 (13)
By: Mike Liu

Overview of this book

If you are a C#, VB.NET, or C++ developer and want to get started with WCF and Entity Framework, then this book is for you. Competence in Entity Framework will be needed to follow the examples in the book, but experience in creating WCF services using Entity Framework is not necessary. Developers and architects evaluating SOA implementation technologies for their company will find this book useful.
Table of Contents (15 chapters)
close
close
2
2. Hosting the HelloWorld WCF Service
14
Index

Querying and updating a database table


Now that we have the entity classes created, we will use them to interact with the database. We will first work with the Products table to query and update records as well as to insert and delete records.

We will put our code in the Program.cs file. To make it easier to maintain, we will create a method, TestTables, put the code inside this method, and then call this method from the Main method.

Querying records

First, we will query the database to get some products. To query a database by using LINQ to Entities, we first need to construct a DbContext object as follows:

var NWEntities = new NorthwindEntities();

We can then use the LINQ query syntax to retrieve records from the database using the following code:

IEnumerable<Product> beverages = from p in NWEntities.Products
                     where p.Category.CategoryName == "Beverages"
                     orderby p.ProductName
                     select p;

The preceding code will retrieve all of...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
WCF Multi-layer Services Development with Entity Framework - Fourth Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon