I have a simple ADO.NET Entity Framework 4.0 model (edmx) which defines database tables with foreign key relationships.
How can I send these entities down to a Windows Phone 7 client? I have created a WCF Service (using WShttpbinding),with the method...
public List<LocationCity> ListCities()
{
var dc = ObjectFactory.GetInstance...
I have a requirement in which in order to make an application extensible and reusable, I have to create a provision through which a user would be able to provide a business object structure (the fields, their types, etc.) through an XML file and using that structure the UI (i.e. the controls and the complete page), the data updation meth...
I have a parent-child table relationship. In a repository, I'm doing this:
return (from p in _ctx.Parents
.Include( "Children" )
select p).AsQueryable<Parent>();
Then in a filter, I want to filter the parent by a list of child ids:
IQueryable<Parent> qry; // from above
List<int> ids; // huge list (8500)
var filtered =
fr...
I've been trying to familiarize myself with the Entity Framework. Most of it seems straight forward, but I'm a bit confused on the difference between eager loading with the Include method and default lazy loading. Both seem like they load related entities, so on the surface it looks like they do the same thing. What am I missing?
...
I am connecting to a MySQL database from Visual Studio 2010 using Net/Connector.
This is the entity framework 4 linq query:
int timeThreshold = 5;
DateTime cutoffTime = DateTime.Now.AddMinutes(-timeThreshold);
try
{
using (var context = new myEntities())
{
var un...
Error: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
I am trying to create a WCF service with Entity Framework (VS 2010, .NET 4). When I run it, I get the above error.
I read something about editing the T4 template, but it appears that it already has
[DataContractAttri...
I am a newbie to ADO.net entity framework. I added 3 tables from the database and tried to query, base.CreateQuery gives exception "an item with the same key has already been added". Validate doesn't show any message either.
FISSEntities SecurityMastercn = new FISSEntities(connectionString);
var vwCadis = from cusip in SecurityMa...
I have two tables: Area and Boss.
An Area has a Boss, it has a foreign key relationship of Area.IDBoss and that is Boss.ID. I hope I'm explaining my question properly. :P
As of now I can manually type in a number in the textbox and it saves correctly, I can also display the name correctly because I'm using Entity Framework, something l...
I'm trying to learn Entity Framework and I'm confused about navigational properties. I have a table named tblUser. It has a column named ManagerId which is has a self referencing foreign key to the UserId column. I've added this table to my EF model and I now have three "links" in my table entity properties:
tblUser1 (type: EntityCollec...
Hi,
is it possible to get entity key from EntityReference property without loading it?
I tried:
entity.EntityKey.EntityKeyValues[0].Value
But if referenced entity isn't loaded by EntityReference.Load() method, EntityKey property is null.
Thank's a lot!
...
Hi all,
I have run into a scenario where Entity Framework 4.0 does not generate an association to an entity backed by a table having a unique index, and I am wondering why.
The basic setup is this: Let's say I have two tables in SQL Server 2008 R2 and a foreign key relation:
CREATE TABLE [dbo].[User](
[Id] [int] IDENTITY(1,1) NO...
Hi,
I'm customizing a COTS product with a rather complex table structure and I'm running into an issue where Entity Framework doesn't seem to know what to do with a foreign key relationship. Here's an example:
Order
Id
OrderDetailId
Foo
Bar
OrderDetailId is a foreign key that references OrderDetail.Id, OrderDetail.Foo2 (combined as ...
I feel like I'm missing something very obvious here but I can't get basic binding to work with objects from my EDM.
Here's my xaml:
<TextBox Text="{Binding Path=receipt.STATUS}" Height="23" HorizontalAlignment="Left" Margin="371,276,0,0" VerticalAlignment="Top" Width="120" />
Here's my View code-behind:
public MainWindow()
{
...
I am using the latest development version of the connector - 6.3.3 beta to connect to a mysql database via the Entity Framework 4 in VS2010.
I have the following Linq statement which uses a TIMESTAMP column - createdDate - in the query. Here is the code:
int timeThreshold = 5;
DateTimeOffset cutoffTime = DateTime.Now.A...
I'm using ASP.net 4 to create a Dynamic Data site. I have a Many-to-Many relationship as described here: http://msdn.microsoft.com/en-us/library/dd742359.aspx
It works fine when my middle table only has the foreign key columns of the parent tables. This is a customer<->products setup, where multiple customers can have multiple products....
I have this service which is Singleton and Single threaded and serves bunch of low volume clients. It uses Entity Framework and Data in SQL Server.
If any one of the client's request to Save Data fails, all the subsequent requests are being failed as every time it is trying to save the original failed data object.
Is there is any way...
In the constructor of each of my POCO's I have this:
this.StartTracking();
To ensure that tracking is turned on for every instance of one of my POCO's. I have an Entity A which contains a TrackableCollection of Entity B. When I load my instance of Entity A like such:
using(MyContext ctx = new MyContext())
{
entityA = ctx.EntityA....
Hi, I'm new to Entity Framework so please excuse if the answer to this question is obvious. We have few databases with thousands of tables in them. Most of these are data tables, that means each data update process might add or remove tables from the database. I've created edmx file with only the tables I need. All the data tables will b...
Hello,
I am having an issue with querying the entity framework (.net 4.0).
I have the following:
public IQueryable<Comment> GetComments(string section, int sectionId)
{
var query = from comm in ObjectContext.Comments.Where(id => id.SectionId == sectionId && id.CommentSection == section)
select comm;
return query;
}
N...
Newbie, please bear with me as I just started yesterday with WCF.
I am using Northwind for the data and only added Customers, Orders, Order Details and Products to the model, so nothing fancy.
When I launch the application and invoke Test, and set a breakpoint, the value for products is there and it completes without error. If I then t...