poco

EF4 POCO one to many Navigation property is null

I'm using VS2010, EF4 feature CTP (latest release), and POCO objects, such as the example below: class Person { public int ID { get; set; } public string Name { get; set; } public virtual IList<Account> Accounts { get; set; } ... } class Account { public string Number { get; set; } public int ID { get; set; } ... } For the sak...

EF4 POCO - Updating a navigation property

I have a Recommendation object and a FeedbackLevel object and the FeedbackLevel object is a navigation property inside a Recommendation object Recommendation int EntityKey; FeedbackLevel Level; Inserting a new one works just fine with AddObject(). Here's what I'm trying with the update, which doesn't work. recommendation.Level = m...

Installing poco library

im trying to install the poco library for visual c++ 2008 but when I type this command buildwin.cmd 90 I get the following error "'devenv' is not recognized as an internal or external command, operable program or batch file." The readme file says there is an alternate way to install poco from visual studio itself but i don't quite k...

Using ADO.net Entity Framework 4 with Enumerations? How do I do it ?

Question 1: I am playing around with EF4 and I have a model class like : public class Candidate { public int Id {get;set;} public string FullName {get;set;} public Gender Sex {get;set;} public EducationLevel HighestDegreeType {get;set;} } Here Gender and EducationLevel are Enums like: public enum Gender {Male,Female,Undisclosed} pub...

Any good (really good) material on Poco C++?

Hardly can I find any good material on Poco C++. Their documentation cannot replace a good 3rd party tutorial enriched with real-world examples and lit with creativity. Please refer some if you know any. Thanks in advance. ...

POCO Support in the Entity Framework

While the application I am developing at the moment is written in .net 4.0 against the beta, I have largely been ignoring POCO support in the Entity Framework because I didn't need it. I'm starting to realize, however, that POCO support would be useful in my project. However, Google searches on POCO in the EF yield a lot of results about...

one-to-one relationships in Entity Framework 4 v2 with POCO

I've been looking for an example about how to build an one-to-one relationship in EF4v2 with POCO's. I found a lot of examples that show only how to create one-to-many or many-to-many. Do you have any resource about it? ...

NHibernate: how do I Merge class without identifier property?

The Merge seem not to have an overload for providing an id, and while SaveOrUpdateCopy does, it still crashes with The class has no identifier property. I am ok with loading the entity first, but is it possible to merge to a given entity with NH? Copying all fields by hand seems unnecessary given that there is already merge functionalit...

How to delete slave entity in entity framework poco in one line

The following code: order.Orderlines.Remove(orderline) means not only to remove relationship between Order and Orderline but also to remove orderline from persistence permanently. Many slave entities have this situation. As I know, in entity framework have to write extra code: context.DeleteObject(orderline); or context.Orderline...

Using Repository Pattern, POCOs and LINQtoSQL with tables of multiple types

Firstly, my previous question will help give some back story. As stated in that question, I have a super-type table (if that is the technical term for it) and I have multiple sub-types in different tables - all with field unique to that sub-type. Events * Id * EventTypeId * AllEventTypes_Field EventType0 * EventId (FK) * EventType0_Fi...

Cast Bindingsoure.Current to POCO

I have a sqldatareader that gets assigned to a bindingsource and a datagridview datasource to that. When I look at the type of Bindingsoure.Current its a DataRecordInternal. How can I cast that to my POCO? Will I have to manually work out which fields in the Current object relate to my POCO. I could do it through my POCO and just tak...

Customized mapping in poco of Entity framework

Sometimes i would like to serialize dynamic properties to one field in database and lazy deserialize field to dynamic properteis in object view, see following in object view: public IDictionary<string, string> _properties; public IDictionary<string, string> Properties { get { if (_properties == null) { ...

How to specify a entity in SqlToLinq not to do update in database.

Hi. Iam using LinqToSql togheter with an XmlMappingFile so a can use POCO. I have an entity that is called Address. And in this Entity I have entity called Country. This entity is populated from database, but that table should never be changed since it has a list of all countries and is "Hardcoded". I have a Club entity that has a lis...

Generate SQL for POCO objects?

Is it possible using nHibernate, or Entity Framework, or whatever, to generate the SQL necessary to INSERT or UPDATE an object I've mapped to a table? I'm looking at generating SQL scripts from these POCO classes instead of running directly against a database. The idea here is I'm taking some 2000+ line SQL scripts and I've made a Pyt...

"Metadata information not found" while using EF4's POCO Template?

I just installed the POCO Template for EF4. I have a single entity in my model, AnnouncementText, and the T4 files seem to be properly generated. Attempting to access this new entity is throwing the following error when I access the auto-generated property MyObjectContext.AnnouncementTexts: InvalidOperationException: Mapping and me...

POCO support in ADO.NET Entity Framework?

Hi All, I want to manually map my Entity Classes(POCO) to the Database tables usin ADO.NET Entity framework using the XML mapping file. Is it possible to do so, as I have heard there is no POCO support in ADO.NET Entity Framework for VS2008( AM I Right?).....I want to use POCO classes in my project ad use the entity framework as an ORM....

Entity Framework 4.0 generated entity set vs POCO with INotifyPropertyChanged/IDataErrorInfo

lets assume I do create the entities and I want data binding + error validation in wpf with mvvm pattern. Where is the advance of Poco? POCO is naked and has nothing... no INotifyPropertyChanged or IDataErrorInfo. Due to way much cumbersome work I do not wrap my entities like Customer in CustomerVM/CustomesVM (collection) etc... I return...

Can a Mock framework do this for me ?

Hello, I am a bit confused from wiki: "This means that a true mock... performing tests on the data passed into the method calls as arguments." I never used unit testing or mock framework. I thought unit tests are for automated tests so what are mock tests for? What I want is a object replacing my database I might use later but still ...

Entitity Framework: Change tracking in SOA with POCO approach

In our layered application, we are accessing database via WCF calls. We are creating and disposing contexts per request. Also we are using POCO approach. My question is, in pure POCO model (completely persistent ignorant POCOs) is it possible to track the changes, while we are creating and disposing context per request (as previous conte...

Can I get a POCO from EF4's function import?

In the context of Entity Framework 4, the default behavior when adding a function import is to call it via ExecuteFunction<T>(), where T must apparently implement some property change notification stuff. (In my case it's generating a complex type derived from ComplexObject.) I don't need or want any change notifications, and I'm requir...