.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

get data from entity model in rest service

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :WCF


I created a rest service and a database in entity model (edmx)..

i want to retrieve data from database and show it in client using a rest service...


is it valid to store like

c1 =



View Complete Post

More Related Resource Links

How to update Domain Service from Entity Data Model?


Hi guys,

So I'm using Entity data model to reflect my database and I generate Domain service from my Entity data model.

I understand that if I have changes in my database, I can just choose "Update Model from Database", but there is no "Update Domain service from Model" option available.

How should maintain my domain service? I'm not going to delete away it and regenerate it whenever there are some changes, right?

I need to know what if

- I add in new table in my database, how should I update from database-->model-->domain service?

- I add in new fields in my table, how should I update from database-->model-->domain service?


Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Data Points: Designing an Entity Data Model


With the Entity Framework, developers are given more flexibility by being able to design around a conceptual model rather than a relational data model. To get started, you need to know how to design an Entity Data Model. John Papa walks you through that process.

John Papa

MSDN Magazine February 2008

Entity Data Model and database view returning the same columns as there are in a table


When adding a stored procedure into the Entity Data Model I can select whether the procedure returns a scalar, a (new) complex type or one of the entity types I already defined. 

How do I do something similar for a view?

I mean assuming I have a view like this

CREATE VIEW FilteredFoos as SELECT Foo.* FROM Foo join ... WHERE ...

(that is a view that implements some involved filtering, but returns all columns from one table) how do I add it to the project so that I can use the entity set, but get the Foo objects, not some new FilteredFoo objects.

var foos = myDB.FilteredFoos.Include("Bar").ToList();

foreach (Foo foo in foos) { ...

Thanks, Jenda

How to post data to WCF REST without entity?

i just make a service like this:[WebHelp(Comment = "Login,Post Method")] [WebInvoke( Method="POST" ,UriTemplate = "Login?lName={loginName}&lPWD={password}&sID={sessionID}&domain={domain}")] [OperationContract] public ResultInfo Login(string loginName, string password,string sessionID,string domain) { return new ResultInfo() { Message = loginName, OptType = ResultType.FAILED  }; }and i call service like this:PostSubmitter post = new PostSubmitter(); post.Url = Constants.SSOCenterURL + "/Login"; post.PostItems.Add("lName", "kkdhf123456"); post.PostItems.Add("lPWD", "edU7qiWjrTzy764cZ7ahEg=="); post.PostItems.Add("sID", "rx543e12xc54235dhd23"); post.PostItems.Add("domain", "localhost"); post.Type = PostSubmitter.PostTypeEnum.Post; string result = post.Post();but service NOT get parametes . The 'loginName' will eques NULL.am i missing something? how to let WCF REST get the post data?thx your view.

Reporting Service Model with db2 data source?

Sorry if this has been already asked.  I searched, but couldn't find it any previous posts. My question is can you have db2 as a datasource in Reporting Service Model?  Currently in the drop down I can only see SQL, which we have a few models over, and Oracle.  We are using SQL server 2008 r1. If not does Microsoft have any plans to add this in the future? Thanks for any help!

Entity Framework POCO and WCF Data Service - Lazy-loading (expand?) related entities?

I've followed ScottGu article on creating an Entity Framework POCO classes for NerdDinners (right now there are only 2 classes, Dinner and RSVP. I then created a WCF Data Service class, which points to my EF class (NerdDinner), everything is working fine, except I can't lazy-load or expand related entities. For example, I want to get all load all the Dinners and their related RSVPs, something like this throw an error:var result = (from d in db.Dinners.Expand("RSVPs")                      select d);The error is a null reference error:at System.Data.Services.Serializers.SyndicationSerializer.WriteObjectProperties(IExpandedResult expanded, Object customObject, ResourceType resourceType, Uri absoluteUri, String relativeUri, SyndicationItem item, DictionaryContent content, EpmSourcePathSegment currentSourceRoot) at System.Data.Services.Serializers.SyndicationSerializer.WriteEntryElement(IExpandedResult expanded, Object element, ResourceType expectedType, Uri absoluteUri, String relativeUri, SyndicationItem target) ... ... ...Any idea why or what I need to do to load related contents?Thank you very much.

Can I create an ADO.NET Entity Data Model for a MySQL database using Visual Web Express 2010?


Can I create  an  ADO.NET Entity Data Model for a MySQL database using Visual Web Express 2010?

If yes, are there any documentation or tutorials?


How do you create a ADO.NET Entity Data Model for a MySQL database using Visual Web Express 2010?


Can I create a ADO.Net Entity Data Model for a MySql(5.0.1) Database using a Visual Web Express 2010? If yes, can anyone please let me know how to do this.

entity data model



in every table's table adapter i had added 4 storedprocedures(CRUD), then i could call this procedures from objectdatasource select,update,insert and delete commands and assign parameters to session objects;

now i moved from dataset to entity framework model.

i want to now how assign a select command to entitydatasource or objectdatasource from imported functions in my entity data model?



Populate entity data model from database


I've been using entity data models for quite a few sections of my website and find it really good for saving things to the database.

After searching for a while, I can't seem to find a good way to populate a new instance with data from a database other than using a data reader. E.G:

MyClass.myID = reader("myID")

Am I missing something?

How use sum in Entity Data Model with linq?



i have a database with 4 table aspnet_Users, Forum, Topic, Post thay are related:

aspnet_Users with Topic by UserId

Forum with Topic by ForumId

Topic with Post by TopicId

i created a linq to get data from Database like:

Dim db As New MelorinEntities()
        Dim Topics = From t In db.Topic _
                     Join u In db.aspnet_Users _
                     On t.UserId Equals u.UserId _
                     Where t.ForumId = _ForumId _
                     Select t.UserId, t.TopicId, t.Name, t.IsLock, t.NumberOfView, _


 now i need to get also how meny post are in a topic but i don't know how to write the querry

can you please help me?



Dynamic Data using Code First Entity Framework Model


I have used Dynamic Data before using LinqToEntity where my Entity model used the Data First model and the GUI.  Now I am trying to use the Code First model witht he Entity CTP 4.  I have my model created and created a new Dynamic Data site.  I read that I need to replace the default RegisterContext call:

DefaultModel.RegisterContext(typeof(PriceLoaderContext), new ContextConfiguration() { ScaffoldAllTables = true });


DefaultModel.RegisterContext(new DomainModelProvider(typeof(PriceLoaderContext)), new ContextConfiguration() { ScaffoldAllTables = true }); 

When I search further on DomainModelProvider, I find that it is part of the WCF RIA. Is this correct? Is this what I need for this to work? Has anyone else done this and got it to work?


How to use ADO.NET Entity Data model for SQL Server CE 4.0????

How to Create ADO.NET Entity Data model for SQL Server CE 4.0????

Perform database operations in data entity model


hi ..

i want to know how to perform database operations link inser,update,delete in data entity model using ado.net data entity model(.edmx)

i was follow the instructions from asp.net site this link
http://www.asp.net/aspnet-in-net-35-sp1/videos/getting-started-with-dynamic-data and i succesfully created .edmx file and i run the

project it load all my table and if i selects a particular table it shows the details of my table..

but i want to perform insert,delete and update operations..i want to put a page and perform this sample operations using edmx..i dont know how to do this operations.

how to do this...
need ur suggestions..

explain me with suitable examples using c# for(.edmx)..


validating data using Entity Data Model



I am using ADO.NET Entity Framework.

i have a table Employee which have the following fields.

  • ID int (primary key)
  • Name varchar(10) not null
  • Email varchar(30) Null

here is the code

EmployeeEnitites e = new EmployeeEnitites();

Employee record = new Employee();

record.Name = "this is my test name.........."; // This produce the error because its MaxLength set to 10 in (CSDL)


e.SaveChanges(); // here i got the error "string or binary data would be truncated"

i want to make automatic Length and Required Field validation in the Entity Framework. 
Is there any way? Please help regarding this issue

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend