entity

Loading Entity from different table in EF4

Lets say I have two entities in my EF model Customer and Address which map to their respective Customer and Address tables in the db. What I'd like to do is load up a Customer and their Address from the db into these entities but from different tables with slightly different schemas. They will then be saved to the Customer and Address ...

Generic Repository Problem EF4 Code First

Hey Folks, I've got a slight problem when using a generic repository with EF4. First let me show you the code I use to access a collection of objects (this is code in the generic reposiroy): public IEnumerable<T> FindAll<T>() where T : class { return ObjectContext.CreateObjectSet<T>(); } Below is an example of this c...

How to create and store a (self-tracking) entity object on the server side?

Hi everyone, I am trying to achieve the following using Entity framework 4.0 and self-tracking entities: 1) The client application request a book form the server by providing an ISBN number 2) The server performs a query on its database to see if the book is already present 3a) If the book is in the database, it returns it. 3b) If t...

Session beans per every entity class OR single session bean for all entity classes?

Hi all, I dont know is this question make a sense. Which approach is better, what are the differences, Using/creating session beans per every entity class OR single session bean for all entity classes? Thanks. ...

Problem Binding Entity Framework Images to GridView

Hi I'm trying to bind the product pictures to my gridview but nothing shows up... Here's the code: Using ProductsCtx As New CAJFBLL.ProductEntities Dim Produtos = (From P In ProductsCtx.produto _ Join C In ProductsCtx.categoria On C.id Equals P.categoria_1.id _ Join F In ProductsC...

Three Entity Intersection Table "many-many-many"

I'm currently working on a data model design (which will be backed by an RDMS). It is based around 3 entities relating to benefits for a member of the organization. The entities are the Benefit, Membership Type, and Provider. I've created a standard many-to-many intersection table to relate two entities, but never 3. I'm wondering if any...

More than one developer using the entity frame 4 .edmx file at any given time

Hi, I am using EF4. Just a quick question, is this a really good framework? We currently make use of a business and data layer as separate projects. The fact that everything is in 1 file in EF4 is this a good thing? How do you distinguish between your business and data layer? How is it possible for more than 1 developer to work on ...

NHibernate Entities and Multiple Associations

I don't know how to phrase the question properly so sorry in advance. Using FluentNHibernate in particular, how would you go about making your entities for some tables that have are being referenced by a LOT of other tables? For example an Employee entity. Employees are generally used almost everywhere and it would make sense for some...

Magento custom currency saving?

I'm trying to get some currency exchange rates in a seperate php file in magento and saving them: <?php // Initiate application $mageFilename = 'app/Mage.php'; require_once $mageFilename; Mage::app(); // Code to create my $rates array /** CODE **/ foreach ($rates as $currencyCode => $currencyRates) { Mage::getModel('directory/c...

How can I postpone the actual DB insertion of my CMP2.1 bean in JBoss 5.1 ?

Hello, I am migrating a Weblogic 9 application to JBoss 5.1, and bumped into the following problem: A session ejb manages CMP 2.1 entities. Those are inserted at the time of the call to MyEntityLocalHome.create() method. Since the database table has "not null" constraints, some of the fields, who are normally set after the call to the ...

Leveraging Windows SharePoint Services approvals workflow for approving entities in a custom application

Sharepoint noob question - apparently I can't even figure out how to google for the answer. We have a custom application in which we need to route entities for 'approval'. There are currently no electronic documents that correspond to our entities. They live in our database and are displayed via screens in our app. Simple enough. No...

How to create advanced search with linqkit

Newbee here: Thinking on using this: http://www.albahari.com/nutshell/linqkit.aspx I am creating an asp .net web app/c#/EF4, where users can perform search from a set of textboxes. Here are the basic rules. User can search on any number of fields. (no fields are required) Each field has an option dropdown to choose "equal" "contains"...

Entity Framework 4 INNER JOIN help

Hello, Can anyone tell me how to write the following query in Entity Framework 4.0? "Blogs" and "Categories" are my entities. The query basically returns me the list of categories and the number of blogs that are in that category. SELECT b.CategoryId, c.Value, Count(b.Id) AS [Count] FROM dbo.Blogs b INNER JOIN dbo.Categories c ON b.Cat...

Create SSDL without entities.

We have a legacy database and want to create a model from scratch. We then want to map the new model by hand to existing tables/views/sps in the legacy database. It it possible just updating the storage schema without creating entities so we can keep the model clean? ...

Entities as views of a table.

Is it possible to create multiple entities as 'views' of one master table? Let me explain. Lets say we have a very large table called Foo in a database which schema we're not allowed to alter. Foo ( Key1, field1, field2, field3, field4, field_n ) We want to create 3 updateble entity types from Foo. FooLite ( Key1, field1 ) FooAlt ( ...

Python: parsing XML document while preserving entities

I wanted to ask what known existing Python 2.x libraries there are for parsing an XML document with built-in DTD without automatically expanding the entities. (File in question for those curious: JMdict.) It seems lxml has some option for not parsing the entities, but last I tried, the entities just ended up being converted to blanks. ...

Connection to Entity Framework from SSIS-package script task

From a script task in a SSIS-package I am calling a method in a DLL that uses Entity Framework. And when I´m debugging it stops in the DLL. Error message: "The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid" I had this error before, when I used ...

Prevent XmlTextReader from expanding entities

I am trying to read a XML document without expanding the entities, do some manipulations to it, and re-save it with the unexpanded entities as they were initially. When using the XDocument directly, it fails to load, throwing an exception tell me it has unexpanded entities: XDocument doc = XDocument.Load(file); // <--- Exception // .....

Sensitive Data in EF4

What would be the best way to hide sensitive data from being exposed when using the Entity Framework? (for example, a table that contains a SSN column...etc) ...

Entity Framework Relationship not saving

I tried following the example from MDSN: link text Here are the snidbits from my save method to add a new car to a currentuser: Private Function SaveMe(Optional ByVal pCar As Car = Nothing) As Boolean Using ctx As New NTEntities() CurrentUser = aspnet_Users.GetLoggedInUser 'Must take care of New and Update...