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

C# EF4.0 POCO - how to set navigation proprety with entity from different DbContext?

I want to set a foreign key on an entity. I have the foreign entity exposed in my user control, and want to set it via WinForms data binding. Here's the catch - the foreign entity was originally loaded from another repository/DbContext, as the user…
Brendan Hill
  • 3,406
  • 4
  • 32
  • 61
0
votes
1 answer

How to upgrade a project to use Entity Framework 5 POCO generator

I am writing an MVC application which is using Entity Framework 5 as its ORM. Actually I copied POCO generator classes from existing application, and as the owner of that code said the project is using EF 4 POCO generator classes, I will need to…
Nirman
  • 6,715
  • 19
  • 72
  • 139
0
votes
1 answer

Is it possible to use both automapping and schema generation with Fluent NHibernate?

I'm using the following: Fluently.Configure() .Database(MsSqlConfiguration.MsSql2005.ConnectionString(connectionString)) .Mappings(m => m.AutoMappings.Add(AutoMap.AssemblyOf() .Where(t =>…
Daniel T.
  • 37,212
  • 36
  • 139
  • 206
0
votes
1 answer

ASP.NET MVC3 Entity Framework - Data Retrieval

I'm developing a report tool for my boss using ASP.NET MVC3 and the Entity Framework. I'm using a POCO model and DBContext to retrieve the data from our database and create the data layer. When I created some sample data it was simple: 2 tables with…
gbills
  • 93
  • 2
  • 8
0
votes
1 answer

Entity Framework 5 concurrency update from DTOs

We're using Framework 4.5 and EF 5.0 which shipped with VS 2012. We have an entity that contains a column named RowVersion which I planned to use for concurrency checks. It'a a "Timestamp" value in the MySQL table which updates itself when…
0
votes
2 answers

Is it possible to have Entity Framework use List instead of ICollection when generating classes from the DB?

Title is pretty self explanatory. I would like to have my EF autogenerated partial classes to use List intead of ICollection.
PercivalMcGullicuddy
  • 5,263
  • 9
  • 46
  • 65
0
votes
1 answer

How to get EF POCOs from System.Data.Entities.DynamicProxies

My question is the same as this one However, I don't really see a solution there. Lets say I have a simple model with two POCOs, Country and State. public class Country { public string Code { get; set; } public string Name { get; set;…
BBauer42
  • 3,549
  • 10
  • 44
  • 81
0
votes
1 answer

Entity Framework Not Giving the correct name in the database

I am using entity framework (for learning) to create the datatable; however, when I run the application, it creates the database column name as: AnaKategori_ANA_CATEGORY_ID. Why is it doing that since I am specifically telling it to name the column…
Adem A.
  • 1
  • 1
0
votes
3 answers

Subscribing to events of one class in other

In my C++ program here, I have created an image button control that has an image button and hit testing function to figure out if a mouse clicked inside the video. class ImageButton{ public: ImageButton(int xPos, int yPos, int width, int…
user1240679
  • 6,829
  • 17
  • 60
  • 89
0
votes
1 answer

SaveChanges doesn't work for TPH entities

I use Entity framework with Generate T-SQL Via T4 (TPH).xaml (VS) and SSDLToSQL10.tt (VS) templates. I have a table TABLE [dbo].[Users]( [UserId] [int] IDENTITY(1,1) NOT NULL, [UserName] [nvarchar](100) NOT NULL, [Password]…
Andrey Stukalin
  • 5,328
  • 2
  • 31
  • 50
0
votes
1 answer

Many-to-many relationship with POCO classes in Entity Framework (DB first)

I have a context that looks like this: public DbSet Users { get; set; } public DbSet AccessGroups { get; set; } public DbSet UsersAccessGroups { get; set; } The database has three tables: Users [Pk = Id,…
amcdrmtt
  • 1,253
  • 12
  • 13
0
votes
3 answers

How to implement and test complex business rules for POCO classes

I'm using EF5 and have entities in POCO classes. My first question is what is the best place to implement business rules and validation? My first guess is to place it directly into POCO class into some Validate() function that gets called from…
Andrej K
  • 1,794
  • 1
  • 17
  • 37
0
votes
1 answer

Loading data in to a DataTable from a SQL Server database and displaying Charts in MVC3

I'm terribly new to MVC and programming in general, and I'm having trouble loading data from a SQL Server database into my MVC3 application. I couldn't get it to work with a model, so I only have a controller and a view. The code looks like…
gbills
  • 93
  • 2
  • 8
0
votes
1 answer

Can I have hand-written simple POCO's without any FixupCollection like the template generator generates?

I want to hand-write my POCO's as simple classes with virtual properties so that the entity framework can generate proxies. I will enable proxy creation (which is on by default) so I can have change tracking and lazy loading. My question is: can I…
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
0
votes
1 answer

The type or namespace name 'FixupCollection' could not be found

I generated POCO's using the EF POCO template. When I build my project, it tells me that I am missing a reference to the FixupCollection. Which library reference am I missing? Here's the error: The type or namespace name 'FixupCollection' could not…
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
1 2 3
99
100