I have a List which hold the PK ID's of a number of objects in a collection that I want to remove. Does anyone know how to write a single query to retrieve these objects?
Eg:
IList<int> objectList; // populated with int Primary key Ids
using (MyEntities context = new MyEntities()){
var result = context.MyObjectCollection.Where(o...
I'm trying to create a function that takes any table from my ADO.NET Data Model in Silverlight. I can't figure out what the base class is for the Entity Objects that it creates for me. Each Entity in the model is of this type:
global::System.Data.Objects.DataClasses.EntityObject
but that type wasn't working in SilverLight.
I'd li...
Hi
I have some tables and I can't get them to map.
aspnet_Users
UserId<PK>
//Other Fields
Table A(intermediate table)
UserId<PK>
Table B
UserId<PK>
Field1
Field2
Field3
Yep when I add these 3 tables in I will either get a 1 to 1 relationship with
aspnet_users to Table A
or
Table A to Table B
I need to have
aspnetusers to Tab...
When I decided to use an OR/M (Entity Framework for MySQL this time) for my new project I was hoping it would save me time, but I seem to have failed it (for the second time now).
Take this simple SQL Query
SELECT * FROM POST ORDER BY addedOn DESC LIMIT 0, 50
It executes and gives me results in less than a second as it should (the ta...
Hi Everyone,
I have the following script that will update the connection string across three different config files used in development.
function Main()
{
pushd
cd ..
$aomsDir = pwd
$configFiles = @( 'util\GeneratePocos.exe.config', 'src\Web.UI\web.config', 'src\Data\App.Config')
$MyAOMSEntitiesConnStr = $env:AOMS_CONN_STR
Write-...
Are there any EF designers out there that actually work? I would like to find an EF designer that isn't the default VS 2008 one. I have a relation between two entities that is absurdly wrong. No, actually I have a related field, it can't highlight the relationship for me because it doesn't exist. I could just exclude the field from ...
The title tells it all, I need to see how others solve this to get a grasp around it. WebForm applications won't help me, as I don't understand WebForms and it would really confuse me (if possible) even more.
If such a example or framework would fit together with Entity framework it would rock my world.
Edit - Added some info:
WinFo...
When I instance my "Entities" object in Entity Framework, and make a couple of queries using that Entities object, what happens to connections?
Does it open a connection when I instance the object, and close it when I dispose of it?
Or does it open and close a connection for each single query I execute?
In either case, is it possible...
I tried following the steps I describe below in VS 2010, but to no avail:
Create new Windows Forms App. Project
Add new empty ADO EDM to Project
Add new entity Customer with scalar properties FirstName and LastName
Generate db script
Execute db script to create tables in db
Add new Object Data Source based on EDM Model1
Select objec...
Hi,
What I really like about Entity framework is its drag and drop way of making up the whole model layer of your application. You select the tables, it joins them and you're done. If you update the database scheda, right click -> update and you're done again.
This seems to me miles ahead the competiting ORMs, like the mess of XML (n)H...
I have an Entity Framework model with table Employees. Each employee has a SupervisorId, which points to another record in the same Employees table. The entity model VS inferred from my DB design looked fine, but I could not update or insert records for the table with the self-reference. I have taken to using a view of the Employees t...
Hey everyone,
I'm working on a WPF system which hooks onto an old legacy database using the Entity Framework. We hook onto a backup of the live data when debugging and an empty database to run tests against. I'm receiving the following error only when trying to delete from a backup of the live data.
This code:
License license = ReadLi...
Ok, so let me explain a little of what I am trying to do.
I have a table called WebsitePage that contains all of the pages on my site with some information about them. Then, I have a Customer table for all of my customers. Then I have another table called CustomerWebsitePage that stores customer values for some of the columns in the Web...
So like many developers before me, I am at the crossroads of choosing an ORM to learn thoroughly and move forward with for future projects. I have been playing with Entity Framework and so far like what I see, although I have only tried simple things, CRUD with clearly defined table relationships with a 1-1 table-entity mapping.
I did so...
I've inherited some code and my current task is to improve it's performance. Straight away I've noticed a foreach loop containing lazy loads of child elements. I'm trying to remove the lazy loads since, in the example below, there's going to be 1 + (3 * n) calls to the database!
using (BaseEntityConnection BaseEntityContext = new BaseEn...
Hello,
I am using the entity framework model to query my database and have put in a few views that I would like to use that all have the same query parameters. Rather than write a big list of case-switch statements I am wondering how to do this programmatically by passing through the view object as a parameter to my main method. In sql ...
I am working on a framework which will provide some basic functionality for a number of applications which our company is going to develop.
The framework will come with a basic database schema which will support this functionality.
Developers using the framework will be expected to extend the database schema with their own tables. Fut...
I'm building an ASP.NET MVC site using the ADO.NET Entity Framework.
I have an entity model that includes these entities, associated by foreign keys:
Report(ID, Date, Heading, Report_Type_ID, etc.)
SubReport(ID, ReportText, etc.) - one-to-one relationship with Report.
ReportSource(ID, Name, Description) - one-to-many relationship wit...
Hello
I'm having a function that should both update and insert, using the entity framework.
Was wondering if SaveChanges should be used in both cases?
if(Something == newThingy)
//do something
myobj.SaveChanges();
or is it done differently?
/M
...
Hello
I just switched from Linq to entities framework, and I'm having problems with methods that returns "all rows". I get: "The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced" error in my "service layer" that calls the data-layer.
I get an error on:
BookingObjectRepository _reposi...