Questions tagged [poco]

Means Plain Old CLR Object, a simple object that does not follow any object model, convention or framework. For questions about the POCO C++ library, please use [poco-libraries].

Means Plain Old CLR Object, a simple object that does not follow any object model, convention or framework. For questions about the POCO C++ library (http://pocoproject.org), please use [poco-libraries].

1553 questions
0
votes
1 answer

Creating collection of class that isn't table with entity framework

Is there any way I can create collection of objects that aren't table? I mean something like - class Deck { [Key] public int DeckId { get; set; } [Required] public ICollection Cards { get; set; } } If I had a…
Videron
  • 171
  • 1
  • 3
  • 11
0
votes
1 answer

How can domain model classes (generated by EF 5 Database First) support custom logic when a database update replaces the code?

Please pardon the long-winded title to this post. Basically, I have an entity model that was generated by Entity Framework 5 using the Database First method. Now I would like to develop those POCO entity classes by adding validation logic and…
BCA
  • 7,776
  • 3
  • 38
  • 53
0
votes
1 answer

Entity Framework code first with Access database

Is there any way I can connect EF with an Access database using code first so that my POCO classes can create the tables in the Access database and everything will save on that file?
Videron
  • 171
  • 1
  • 3
  • 11
0
votes
2 answers

ef get fields only in base class

public class baseEntity { [Key] public int ID { get; set; } public string Name { get; set; } } public class ProjectEntity : baseEntity { public string Address { get; set; } public string PhoneNo { get; set; } } public class…
iwaitu
  • 205
  • 1
  • 2
  • 8
0
votes
2 answers

Entity Framework POCO Eager Loading children

This is my POCO entities scenario: Manufacturer (1) has Cars (*) One Car entity has a navigation property to a Manufacturer entity. One Manufacturer entity has a navigation property to a Cars collection I need to query all Cars of a specified color,…
hamiltonjose
  • 461
  • 5
  • 14
0
votes
1 answer

How do I make a self reference in Entity Framework Code First?

I have a device class, computer class and a virtualdesktop class. Every computer is a device and every virtualdesktop is a computer. I want to add a property to my virtualdesktop that references another device of type computer indicating where…
Bill Greer
  • 3,046
  • 9
  • 49
  • 80
0
votes
1 answer

Make a new generic list from a list within a list in Linq with lambda expressions?

Okay so I have a POCO class that may contain another POCO class as an array. In some instances when I get the data I want to CREATE a list of the lists but not as a level down but all on the same level. I think I am missing something very simple…
djangojazz
  • 14,131
  • 10
  • 56
  • 94
0
votes
0 answers

Entity Framework 4.1: code first - Foreign key restriction error

I have a base class, let me call, Entity_A which only has a property 'ID' that is the primarky key. public abstract class Entity_A { [Key(), Required] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public Guid ID { get; set;…
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
1 answer

Entity Framework code first: POCO's inheritance

I have an issue when defining some POCO objects (entities) in entity framework code first 4. I have a main entity, let's say Entity_A, which has only a property, only the ID (primary key). The rest of entities (Entity_B in this example) inherits…
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
1 answer

WCF, POCO and inheritance: data contract issue

I have a WCF server application using Entity Framework 5.0 and POCO entities. The server serializes POCOs directly to the client application over WCF (I managed to do this by following instructions in the following blog post:…
0
votes
1 answer

Entity Framework, Code First Foreign Key Mapping Error

I am having the hardest time figuring the right configuration for mapping a foreign key "Category" to my "Products" table. When the model is being generated (Code First), I am getting this internal exception message. {"Unable to determine the…
Jeff Pearce
  • 581
  • 7
  • 15
0
votes
2 answers

In a repository with c#, poco's and ado.net what is best, one class for entire repository or several classes per entity?

I'm creating a repository for my project, actually a subset of it, with c#, poco's and old ado.net (no ORM's). I've several entities and my repository will CRUD those through a DAL. My DAL is IDisposable so I managed to open a connection to database…
ramires.cabral
  • 910
  • 4
  • 13
  • 28
0
votes
1 answer

How to update a poco with Enterprise-Library 5.0

I would like to pass poco properties to an stored procedure (update and add the Object) With earlier versions of Enterprise Library (e.g. v2.0) I can do something like this: var arrParam =…
0
votes
0 answers

Building C++ application with pre-build library gives compile errors

I am trying to modify a C++ program by including POCO to be able to do a HTTP request and receive a result. Basically, I just need within another C++ program to give a username and password and get a plain "OK" or "ERROR" response. I am not familiar…
Luuk D. Jansen
  • 4,402
  • 8
  • 47
  • 90
0
votes
1 answer

Table not removed in EDMX after deleting in SQL

AM working with MVC4 VS2012 and EF5. I created a EDMX using the DataBase and the POCO(TT) Classes were generated Automatically. Followed this way Entity Framework 5 and Visual Studio 2012 POCO Classes in Different Project to move POCO to different…
Peru
  • 2,871
  • 5
  • 37
  • 66