entity

Update entity framework objects

Hi, I transfer data between the entity framework and the business layer and user layer by using Data Transfer Objects. I do have some doubt, if I retrieve an object which is converted to a DTO, how do I update the correct object in the entity framework and not just insert a douplicate? ...

ADO Entity Framework creating unwanted Entity Key

Hi, I need to use tables from a DB which I cannot alter (using linked server). So part of my schema is a view on these table and I cannot create an FK in my DB. When I come to creating the association in ADO.NET Entity Framework I am getting problems because a second column on the table from the external DB has an index on it and the EF...

Entity framework and foreign keys

Hi, I have two tables a car tables which contains different properties for a car, and a carmodeldefinition which is a foreign key to a table with the same name. The cardefinition table contains the different cars and models. I have mapped them in the entity framework http://img21.imageshack.us/my.php?image=entityframeworkfk.jpg (can't g...

Using the repository pattern with Entity Framework (mvc storefront)

Hi, can anyone give a helping hand, I been watching the videos for the mvc storefront and have create my own website using these techniques i.e. DDD, Repository pattern but i wish to use Entity Framework. In the Interfaces it returns IQueryable but with the entity framework i should return ObjectQuery instead? - I will be using LINQ. ...

HTML Entity displaying wrong in Camino

I'm trying to show the characters ☜ and ☞ in my HTML page. Every single browser I've tested displays them properly, except for (inexplicably) Camino. Instead, it shows this: That's what it renders for ☜. The symbol it shows for ☞ is similar. If for some reason you can't see those characters properly, here's the HTML entities I'm usi...

Repository Pattern with 2 services & 2 dataccess layers - C# DDD?

Can anyone help, I have 2 applications and they are nearly identical. they have a completely different presentation layer (web) and the business logic and database are nearly identical. Basically one app has some things that the other doesn't. so i was wondering if i can do the following without breaking any rules etc Each app has thei...

How do I get all the entities of a type with a required property in Google App Engine?

I have a model which has a required string property like the following: class Jean(db.Model): sex = db.StringProperty(required=True, choices=set(["male", "female"])) When I try calling Jean.all(), python complains about not having a required property. Surely there must be a way to get all of them. If Steve is correct (his answer...

how to create insert query on the fly, in entity framework using create query method?

I am using something like the above sample code but when i try to execute it, it says that the query syntax is wrong and there is an error in the query syntax near keyword into... System.Data.Objects.ObjectParameter[] opc=new System.Data.Objects.ObjectParameter[1]; //just sample opc[0]=new System.Data.Objects.ObjectParameter("columnna...

NHibernate and Life Cycle Events

Can someone give an example to what Ayende is talking about in item #17 on his list of 25 Reasons Not To Write Your Own Object Relational Mapper Is this something that ADO.NET Entity Framework can do? ...

xml: is multiple level !ENTITY usage possible?

We are using XML to define a schema for controlling the contents which can be displayed in a diagramming tool. The schema file specifies what kinds of object can be placed on the diagram, how they can be linked together, and what properties these objects have (that is, what settable properties apper in the editor). When a new kind of di...

Instantiating a context in LINQ to Entities

I've seen two different manners that programmers approach when creating an entity context in their code. The first is like such, and you can find it all over the MSDN code examples: public void DoSomething() { using TaxableEducationEntities context = new TaxableEducationEntities()) { // business logic and whatever else ...

How to use entity resolver in MSXML

I'm trying to parse an XML document using MSXML v4 in C++, using my own entity resolver to re-direct the parser at local DTDs on my own hard-drive, rather than allowing the parser to go online to get the DTDs from their locations as specified in the XML file being parsed. I've managed to get this working with Xerces, but the behaviour I'...

NetBeans 6.7 Beta - Why does it think certain tables have no primary key?

I am using NetBeans 6.7 Beta to create entity classes from a MySQL (version '5.0.45-log') database. NetBeans accepts most tables, but rejects certain ones consistently (I can't see a pattern), saying they have "no primary key". All tables are using the InnoDB engine. All tables have primary keys of one or more columns. The MySQL query br...

LINQ or ADO.net Entity Framework - which to learn?

A bit of a clarification: I was browsing Julia Lerman's Oreilly title on Entity framework and I got mighty confused. I have Charlie Calvert's essential LINQ, but from my 10 minute session with Lerman's book, it transpires that LINQ is LINQ to SQL which seems underpowered with its DataContext object etc... Whereas Entity Framework is th...

Is there deep loading in subsonic?

Hi, I am new in subsonic, and can't find the way to load data whith it's parents or childs data in one query. Is it possible in subsonic? ...

XSLT and XQuery on invalid html input, pieces of URI look like entities

I'm using Saxon 9 to analyze invalid html sources. Specifically the html has href values like the following: <a href="blah.asp?fn=view&g_varID=1234">some text</a> I'm getting errors: "Error reported by XML parser: The reference to entity "g_varID" must end with the ';' delimiter." The xml parser is reading the "&g_varID" string and...

Using an Entity (and their Primary Key) as another Entity's Id

So, I'm not sure how to ask this question, as it seems like it should be pretty easy to find the answer to this one. I have 3 tables; ContentHeader, ContentType1 and ContentType2. ContentHeader has a primary, auto-increment key. ContentType1 and ContentType2 both maintain foreign keys to ContentHeader's primary key. These foreign keys ...

Inherited Tables Not Accessible In ADO.NET Data Services

I am currently working on a project where I create a Data Service based on an Entity Data Model. In my Entity Model I have several inherited entities (Such as Orders (Base), Prescriptions (Inherited)). From my data services I am having a problem through the data service where I can't reference the inherited type (prescriptions) only th...

LINQ Entities as business objects - pro/cons

Hello all, the dbml file generated by Visual Studio (sqlmetal) comes with entities mapped to database tables. In your opinion, these clases are suitable to be used as domain model classes? Or should we avoid them and isolate them into the data access layer only? Thanks ...

Storing Multiple Changes in Entity Framework

Hi there, I'm trying to achieve a form of two phase commit using Entity Framework 1.0. What I would like to achieve at a high level is: get all the data from the database and store this in a cache. modify individual entities Commit all changes into the database The problem's i've encountered so far is that caching an IQueryable ...