Hi,
I’m having trouble with some dbml generated classes that don’t to resolve down to efficient SQL. Imagine I have an Accounts table and a Transactions table where each transaction is associated with a particular account. I load all this into dbml and out pops an Account class and a Transaction class. The Account class has an Entity...
Having a bit of a mental block about how this should work:
I have two tables Location and Country. Within the Location table I have a FK to the Country table PK which is CountryCode.
The Country table is filled with static data and each time I add a new location I will link to the Country with the appropriate countryCode.
I can do ...
I have an app that is saving to a db (using Entity Framework) and saving documents to Sharepoint in a single save. I'm attempting to use MSDTC with a TransactionScope.
Part of my EF insert logic includes passing a list of foreign keys to the data layer. The layer retrieves the "foreign key'd" object from the db and then adds it to t...
Given these Entities auto generated by EF...(pseudo)
class CreditCard
{
int ID {get;set;}
string Number {get;set;}
}
class Person
{
EntityCollection<CreditCard> CreditCards {get; set;}
}
What is the best way to merge a disconnected List into the CreditCards property of Person.
A List will be constructed on a WebForm based...
My site is small now but it is steadily getting popular online. It is running SQL Server express and entity framework. I am not storing any pictures in the database, the database is storing just text. What kind of costs would I be looking at if my site gets big enough where I need to upgrade my database to a paid version and run the data...
I have a database I'd like to create an entity from, and then generate RESTful output.
My objective is to add a property to one of the tables once it becomes an entity. The data for that property would be one I'd come up with through calculations done on a few different fields in the table. From there, the code generator would create ...
I have just merged several identical legacy tables, DeptL1, deptL2, ..., deptL*n*, where L is a reporting roll-up level, into one table, Dept, with a new ReportingLevel field. In my previous model, several entities, e.g. Employee, had an 'FK' relationship only with DeptL1, where they now have an 'FK' relationship with the whole Dept tab...
Hi there
I saw a ADO.NET EF and LINQ pagging structure like this:
var query = ...your normal query here...
int totalRecordCount = query.Count();
var pagedQuery = query.Skip(PageIndex*PageSize).Take(PageSize);
This code seems to query all records setting them into the local memory, so it gets the total count. After that, it pages de r...
I'm building an ASP.Net/MVC application using SQL 2008 Developer edition and a DB in Sql2005 compatibility mode. Using Entity Framework as DAL.
My problem is that I have a table where I'm using the integer identity column in a like an Invoice Number, that is, it always has to be unique and never reused. So using the GUID column type w...
Does Visual Studio 2008 SP1 / .NET 3.5 support Linq to Entities (ADO.NET Entity Data Model / edmx) with SQL Server 2008 R2? Specifically, the hierarchy id type? If so, do you have a download link, if not is there a published date when this feature will become available? I experimented a bit today after installing GDR R2 to support Sql...
I am creating an object called "letter" which has multiple "recipients" added to it.
when savechages is called on the context i get this error.
"Entities in 'EchoEntities.LetterRecipients' participate in the 'FK_LetterRecipient_Letter' relationship. 0 related 'Letter' were found. 1 'Letter' is expected."
Also when only adding 1 recipie...
Where can I find the .NET Framework 3.5 Entity Framework Sample application files that are described in the MSDN documentation?
The download link in the MSDN documenation is a link to the Visual Studio 2008 SP1 download.
...
I need to decide about the DATA Access Layer of a medium sized web application to be run on the intranet of a company. I've worked with CodeSmith before and found it useful but it consumes lot of development time if the underlying database schema changes, so would like to do away with it and try my hands with some new DAL which would hel...
Hi!
I am using generic repository pattern with methods:
private ObjectQuery<T> ObjectQueryList()
{
var list = CamelTrapEntities.CreateQuery<T>(EntitySetName);
return list;
}
public IQueryable<T> List()
{
return ObjectQueryList();
}
Metod List() returns IQueryable<T>, becase IQ...
I'm about to start working on a new project and am wondering if "Code Only" is the right way to go. We're also considering the other model-first approach through the designer, but would rather design my domain models outside of the EF designer.
Our domain will likely contain 100+ entities. I've read that a huge number of entities can ...
I’m currently working on a prototype of a medium size web application, and I thought that it would be good to also experiment with Entity Framework. The problem is that the major part of the application is not the data layer and logic, and so that I don't have much time to play with Entity Framework. On the other hand, the database schem...
Background
Currently I have a C# Silverlight business application which uses RIA Services. The application is hosted in ASP.NET using the ADO.NET Entity Framework and a domain service class to read and write to the SQL Server database.
Scenario
I have a server-side method in my DomainServiceClass that returns an IEnumerable list of ob...
Hi,
i just wanted to ask if there is a way the reject all changes made to a ADO.NET Framework model with its relations?
Auditing in Entity Framework describes a way the restore the original value of a single entity. But is this possible for all unsaved changes in the whole database?
...
I'm trying to present MySQL server data in a silverlight client and my current plan of attack is to use Entity Framework to MySQL with RIA Services providing the data access between the Silverlight Client and Entity Framework.
However, I'm only trying to present data to the user and I do not want the possibility of me or someone else be...
Hello guys,
In my project I want to run some unit tests on the DAL layer that is using EntityFramework. I'm creating from scrips a new database before each run of the tests (in order to have always the same initial data when doing the tests). At the end of the tests, this database is dropped, (all is made automatically with the help of ...