I know it's not a "programming" question per-se, but come on guys - give me a break here...
I'm working at a large scaled, really slow organization.
We recently started a process to decide on a new ORM technology.
After looking in various forums, and test-programming with NHibernate, I think it's awesome. Only problem is, I know that...
Hi guys,
I am trying to achieve a query which includes a subquery which itself includes grouping.
I based my code from answers to this question
The purpose of the code is to perform a simple de-duplication of the 'person' table based on the email address and return the latest person row.
var innerQuery = (from p in db.Person
...
Hello
I have a problem with many-to-many relation on EF4 and npgsql provider.
I have 3 tables: Order, OrderStatus and OrderStatusDict (dictionary). OrderStatus is some kind of changeLog - every order's status change is added to the OrderStatus table with its actual date and new status. I need to get all orders, which status.OrderStatus...
Hi,
I am working on an old database, that i do not want to touch or modify in any way if possible.
I want to build a new application that uses it's data but the database has no actual relations despite having primary and foreign keys linking tables.
If i import these tables into an Entity Framework model and add the associations manual...
I like the option of doing model first design with the Entity Framework (4). However, I haven't been able to find out how to add an additional index to a table besides the primary key.
Is this possible in the visual designer? Or do you need to add an index manually after creating the database (which would be a shortcoming of the design...
I'm looking for the best way to handle columns which are calculated on the database (not at the client). The reason for that is performance.
For example this is an invoicing program, and next to each customer I want to display a current balance (all invoice amounts minus all payment amounts). I can think of 3 ways to accomplish this:
1...
Using Ado.Net Entity framework, I am trying to get the 'top 3' items in a table based on the amount of times they appear in a table.
For example:
Table:
basket_to_product_id | basket_id | product_id
I want to see how many times product_id occurs, and would like to return the top 3 product_ids that occur the most frequently.
I'm stuck...
I have a simple inheritance in my model. The class of an entity is defined by a field (RecordType: int). Now I would like to create a SQL to Entities query where I need to filter only one inherited class.
When I use
ctx.CreateQuery<InheritedEntity>()
it fetches all the classes, rather than only InheritedEntity class.
I tried referr...
I think this is just a syntax issue (me not fully understanding linq)
I have 2 tables in my entity model , despite having the same key id ([report_relation_id]) I do not have them joined in the model. All I want to do is select all the records in one table where the id fields are equal - and pass in a parameter to the joining table to l...
I can map 1:1 (one-to-one) tables intuitively, like this:
But I cannot understand how to do the same mapping between a table and a VIEW, like this
In this diagram the two entities are represented. If I manually create an association in the entity model, and set up its mapping like this:
Then I get the error:
Error 3021: Prob...
I have taken the POCO tt templates that can be used in Studio 2010 with Entity Framework and modified them to better fit my needs. I have added a few things to make testing easier.
Now I want to be able to right click on the entity framework design surface, choose "Add Code Generation Item" and select my templates instead of the built ...
I was working in L2E with 3 simple tables, whose purposes a fairly straightforward: Users, Users_Roles, Roles.
Users had a 1:many relationship with Users_Roles, referenced on the column UserID (a uniqueidentifier). At the time, Roles had no relation to any tables. I brought all 3 tables into the designer, which reflected the mapping of ...
I have seen a lot of tutorials for Entity Framework CodeOnly that utilize an object called "Relationship".
http://social.msdn.microsoft.com/Forums/en/adonetefx/thread/6920db2b-88c7-4bea-ac89-4809882cff8f
Like this. But I cannot seem to find that object. I cannot figure out what library it is in, I cannot find it on the MSDN library, I ...
I've got an application set up with RIA Services, Entity Framework 4, and Silverlight 4. It is set up in the fashion prescribed on MSDN here: Walkthrough: Creating a RIA Services Solution
On the client side, this code loads the customer entities into a grid's ItemsSource:
public MainPage()
{
InitializeComponent();
...
I'm doing a simple test in Visual Studio 2010 using the ADO.NET Entity Framework, and the very first table's put a snag for me to hit: there are a couple of data tracking columns that have no use in the application (they're used for auditing), but EF is forcing me to map them because they're non-nullable and EF claims that they have no d...
Does ADO.NET Entity Framework 4 work with SQL Server 2005?
I'm having trouble getting EF to work and I'm wondering if it's because of our version of SQL Server.
...
Hey Everyone,
I have a DbConnection object (coming from an EntityFramework 4.0 context) and was wondering if it is possible to create a Microsoft Practices Enterprise Library Data Access Block Database (Microsoft.Practices.EnterpriseLibrary.Data.Database). Does anyone know if it is possible to do this?
...
I have an entity with three columns, a, b, and c. If I project the ObjectSet to objects of an anonymous class:
var ret = e.foos.Select(x => new {
a = x.a,
b = x.b
}).ToList();
Then the actual SQL only includes the columns necessary to populate each object:
SELECT
[Extent1].[a] AS [a],
[Extent1].[b] AS [b]
FROM [dbo].[foo] ...
Is it possible to clear an EntityCollection without having to Load() it?
I have code in place that uses stub entities to add new entities to an EntityCollection without having load the actual Entity I'm adding, but is there some equivalent to this when Clear()ing an EntityCollection?
...
Is there a way I can map generated entities to enum?
And what I mean is simple:
class Person
{
RelationshipStaus RelationshipStatus { get; set; }
}
enum RelationshipStatus : byte
{
Single,
Married,
Divorced
}
The property RelationshipStatus in the DB is a simple byte, I want that in my project it should be an enum.
...