entity

Cant convert poco object from EF 4 to JSON.

Im working on a mvc 2.0 application using the entity framework. With the entityframework I use the repository pattern with poco objects. To start off with the issue, when I convert an entity object to json I get a circular reference error. After some search I discovered that there are proxy's generated to support lazy loading. If there ...

create entity - google app engine - most convenient way?

whats the most simple way to create a new entity in google app engine? i used now a simple servlet form, but it is annoying to upload a project only because you want to create a new entity. i am using eclipse with java. ( creating entities is documented on google only for python ) ...

Html entity encoding in webapplication

Hi folks, Iam looking for all your valuable suggestions for avoiding a vunerbility through form data in a web application. Which characters needs to be encoded to avoid such injection attacks as part of html entity encoding?.Injection of which chars into our form data will prone to HTML Injections? As of now we are vaidating \",/,\,:,*,?...

Entity model assembly build on command line

Is there an alternate way of building an entity framework assembly (i.e. with csdl, storage and mapping resouces) at the command line (i.e. csc etc) without the use of msbuild. Our build process and environment is a bit out of date. ...

Access Other Entity Collections from Entity Partial Class

I have an entity class that has a property that contains a business code. I would like to add a property that will contain the description of that business code. To do this it will require that I query another entity collection, but the entity collection doesn't seem to be accessible in the partial class of the entity. I can't solve t...

Does an associaton behave differently than a relationship?

I'm using the entity framework My customer class has an AccountID property that includes account information from other tables (such as address and specific account info) by loading the other tables into the property based on their relationships. like this: tblAccount acct = new tblAccount(); tblCust cust; tblAddress addr; public Cus...

Entity framework - Modify a list of children objects

When I have a parent Entity hold a list of other entity (one to many relationship), I modify this list then call function to save the parent Entity. With the entities has removed from this list, is that the framework will delete them from database? And also the new entity has added to the list will be added to database? thank for your he...

Adding a constraint to a JPA or Hibernate entity column using annotations

I want to have a column for an entity which only accepts one of an enumerated set of values. For example let's say I have a POJO/entity class "Pet" with a String column "petType". I want petType to only allow one of three values: "cat", "dog", or "gorilla". How would I go about annotating the getPetType() method in order to have a dat...

Interface as property return type when underlying type *could* be different?

Sorry about the title. I do realize it's not very descriptive. :| Here is my problem. I have a Table class that defines various properties found for a database table. Within this object I also have a property called PrimaryKey. PrimaryKey can either be of type PrimaryKey (I know, confusing) or CompositeKey. Evidently, a single column pr...

Entity Framework function import: input parameters mapping

Hi everybody, Entity Framework allows to map the result of a stored procedure to an Entity easily. What I need is to map an Entity to input parameters, so that instead of context.SaveUser( user.FirstName, user.LastName, ... ); I can simply call it like this: context.SaveUser( user ); What I really want is to isolate possible schem...

Can anyone recommend a tutorial for how to create and use an entity class in C# for VS 2008?

Can anyone recommend a tutorial for how to create and use an entity class in C# for VS 2008? Thanks! ...

File naming conventions

Hi, Please help me for the naming of the class file that defines the property of each value (Entity class). Example: for a dataset file we will use the name like this: dsxxx. But i don't know what will for entity class Please help me for that. thanks in advance. ...

Entity framework 1.0 issue

Problem is it seems that when I use the code below to assign the location values obtained from a ListBox to the division being created/edited EF creates a new location and then enters that locations ID and the divisions is into the DivisionLocation table thus creating multiple locations unnecessarily, as depicted below. using (FRLEntiti...

Entity Framework 4 and POCO

I'm trying to get started using the latest Entity Framework 4 release on Visual Studio 2010 to create a simple WCF application. I would really like to start using POCO objects as opposed to EntityObject classes to serialize. I have been looking for some good write-ups about how to implement custom POCO mappings for Entity Objects but can...

How to make this LINQ To entity method work when it has Nullable LEFT JOIN

Here is the code snippet, actually the whole method. This method works f,ine when NULLAblE Foreign Key Refernces has value. When the value is not there, then this method does not work. My idea is to get all the records even if the references column is NULL. Here is the code : public List<PostedJob> GetPostedJobs(int startingIndex, int ...

Are Entity Framework Models Reusable With Multiple Data Sources?

I'm planning an architecture where we have several legacy databases all having somewhat similar (but not exact) schemas. I'd like for my application tier to have a single, unified model that is filled from the appropriate data source at runtime. Does Entity Framework allow me to declare a single conceptual model with mappings to and fr...

How to update only one field using Entity Framework?

Here's the table Users UserId UserName Password EmailAddress and the code.. public void ChangePassword(int userId, string password){ //code to update the password.. } ...

Silverlight dataform blanks out textbox when focus is given to other textbox on form.

I have a data form that I assign a new Entity class as its current item. The problem is when i tab from one textbox on the dataform to the next the first one reverts back to a blank textbox. If hit save it will save the values you typed buy you cant see them once you tab or click on the next texbox. Below is my xaml and code behind. < ...

ASP GridView DataBind with Entity Navigated property

Hi, I have a GridView DataBind with entity ClassA's properties that is working fine. I am able to directly bind below properties in ASPX file. ClassA.Id ClassA.Name etc. But ClassA also have a navigation property to related ClassB. I would like in a the same GridView to display related classB's properties. I try to bind the following ...

How do I buid a WCF Query on the fly?

I'd like to build some linq or alternatively, build a query string on the fly and pass it to a WCF Data Service (with Entity Framework data model). Something like this: public List<DocumentInformationRecord> SearchClientDocs(string clientCode, string clientName, string contactName, string groupCode, string groupName, ...