<asp:FormView DataSourceId="edsAccounts">
<ItemTemplate>
<asp:TextBox Text='<%# Eval("Email") %>' />
<asp:DataGrid ID="dgReports" DataSource='<%# Eval("Reports") %>'>
</ItemTemplate>
</asp:FormView>
<asp:EntityDataSource ID="edsAccounts" runat="server" ConnectionString="name=Entities" DefaultContainerName="Entitie...
I've got an EF hierarchy that (dramatically simplified) looks something like this:
class Room { EntityCollection<Session> Sessions; }
class Session { EntityCollection<Whiteboard> Whiteboards; EntityReference Room; }
class Whiteboard { EntityCollection<WhiteboardShape> WhiteboardShapes; EntityReference Session; }
abstract class Whiteboar...
Hi!
I have a Contact entity that exposes a navigation proeprty for child Phone entities.
Public Class Contact : Inherits EntityObject
Public Property Phones() As EntityCollection(Of Phone)
EndClass
I want to Xamly retrieve the first phone of the bound contact.
I tried the following but it doesn't work.
Note: I also tried Phon...
Does any one know if there is kinda implementation/addon for VS 2008 SP1 for pluralization service in entity framework like there is gonna b in vs 2010?
example:
In database:
Entity Order
---OrderId
---CustomerId
---OrderDate
Entity Customer
---CustomerId
---Name
In EDM:
Order.Customer
Customer.Orders
DataContext.Orde...
Should I avoid using Include in queries, or I can rely on the EDM that when it creates the query it excludes from the query items that already exist in the OSM?
...
Hi I was wondering if EntityReference.Load method includes
If Not ref.IsLoaded Then ref.Load()
My question is basically:
Dim person = Context.Persons.FirstOrDefault
person.AddressReference.Load()
person.AddressReference.Load() 'Does it do anything?
...
What is the opposite of:
Dim ad As New Address
Person.AddressReference.Attach(ad)
I mean how do I delete the Person.Address? (both with deleting and without - meaning only delete the relation)?
...
Hello, instead of talking let me talk with code:
Dim Contact = Context.Contacts.Include("Phones")
Dim phone = Contact.Phones(0)
Contact.Remove(phone)
How do I refresh the context now, canceling last relation deletion?
I tried:
Context.Refresh(RefreshMode.StoreWins, phone) 'Doesn't recover the relation
Context.Refresh(RefreshMode.Sto...
I have an element bound to an entity (Contact) that exposes some navigation properties.
I want, that on some action (i.e. a "Load children" button), the Contact should load for all its children and grand children like I can do with an ObjectQuery.Include before the execution; example (pseudo):
DirectCast(element.DataContext, Contact).S...
I'm using VS2010, EF4 feature CTP (latest release), and POCO objects, such as the example below:
class Person
{
public int ID { get; set; }
public string Name { get; set; }
public virtual IList<Account> Accounts { get; set; }
...
}
class Account
{
public string Number { get; set; }
public int ID { get; set; }
...
}
For the sak...
I have a Recommendation object and a FeedbackLevel object and the FeedbackLevel object is a navigation property inside a Recommendation object
Recommendation
int EntityKey;
FeedbackLevel Level;
Inserting a new one works just fine with AddObject(). Here's what I'm trying with the update, which doesn't work.
recommendation.Level = m...
I retrieve a collection with the following query:
var numbers = _betDetailItem.GetBetDetailItems().Where(betDetailItem => betDetailItem.BetDetail.Bet.DateDrawing == resultToCreate.Date && betDetailItem.BetDetail.Bet.Status == 1).Where(condition);
Right there I'm able to access my navigation properties and navigate through binded info....
I have two Entity classes: Order and OrderItem. Order contains a navigation property OrderItemSet of type
System.Data.Objects.DataClasses.EntityCollection<OrderItem>
On an aspx page is a FormView bound to this EntityDataSource:
<asp:EntityDataSource ID="EntityDataSourceOrder" runat="server"
ConnectionString="name=EntitiesContext...
I have a question, much liket this unanswered one. I'm trying to work with the entity framework, and having a tough time getting my foreign tables to update. I have something basically like this in the DB:
Incident (table):
-ID
-other fields
Responses (table):
-FK:Incident.ID
-other fields
And and entities that match:
Incident (entity...
Is there a way to make this code excute in one query with Entity-Framework?
Private Sub LoadFirstPhone(vendor As Vendor)
If Not vendor.ContactReference.IsLoaded Then _
vendor.ContactReference.Load(MergeOption.AppendOnly)
vendor.Contact.Phones.Load(MergeOption.AppendOnly)
End Sub
I want two things:
I want to be able...
I am having some trouble with refreshing the related collection of entities.
Essentially the problem is as follows:
public class Student
{
public virtual ICollection<Lecture> Lectures { get; set; }
public void AddLecture(Lecture lecture)
{
Lectures.Add(lecture);
}
public void CancelChanges()
{
...
Hey folks,
I've been learning MVC 2 and I have pretty much everything understood except for the model part of things, I understand what the model is but actually implementing it has me confused.
Here's my situation, I have my DB which has 3 tables;
Ideas - table of ideas
Tags - table of tags
IdeaTag - link table connecting the above 2 ...