locked
404 error when calling SaveChanges after DeleteObject RRS feed

  • Question

  •  

    Hi Guys,

     

    I have an entity that has some relationships. I delete the bindings between the relationships and then call DeleteObject().

     

    If I now call SaveChanges() on the wpf client using a WebDataContext and a 404 WebException is thrown but the data has been deleted successfully from the database. Looking deeper into the error it seems to be trying to put one of the related pieces of data to the webserver...

     

     

    Code Snippet

    if (_courseTrainees.Trainees != null)

    _webContext.DeleteBinding(_courseTrainees.Trainees, "CourseTrainees", _courseTrainees);

     

    _webContext.DeleteObject(_courseTrainees);

    _webContext.SaveChanges();

     

     

    The SaveChanges command tries to do a PUT on http://devsource/CourseTrainees(1,1)/Trainees which obviously fails as that CourseTrainee has been removed...

     

    Any ideas?

     

    Friday, March 7, 2008 4:38 PM

All replies

  • Can you please share the model? You can do something http://devsource/$metadata and it show return you an xml file which gives you the metadata. This will help us in figuring out what the problem is.

     

    Thanks

    Pratik

    Monday, March 10, 2008 6:03 PM
    Moderator
  • Thanks for the response, Pratik. Metadata will be in the next post due to character length.

     

    The entity I have been testing with is a ManyToMany table within our database with a payload. We have Courses and Trainees with a CourseTrainees entity in between and a flag called 'Attended'. Courses is not dependant on anything but Trainees is and CourseTrainees is dependent on both with CourseID and TraineeID forming it's primary key.

     

    When retrieving an entity directly and then deleting the entity, calling SaveChanges does not throw any errors. However, if an entity has LoadProperty called on one of it's relationships, calling SaveChanges after a deletion causes an error to be thrown on the Astoria server about 'Referential integrity constraints violated: Can not change property which is a part of referential integrity constraint when entity has a fixed key.' and a WebException with '(400) Bad Request'.

     

    Next, I've tried DeleteBinding using the code below:

    Code Snippet

    CourseTrainees ct = gData.CourseTrainees.First();

    gData.LoadProperty(ct, "Trainees");

    gData.DeleteBinding(ct.Trainees, "CourseTrainees", ct);

    gData.DeleteObject(ct);

    gData.SaveChanges();

     

    Now this creates the error mentioned above where SaveChanges successfully deletes the CourseTrainee but then attempts to do a PUT on the Trainee related to CourseTrainee (I'm assuming it's trying to delete it because of the DeleteBinding) causing the 404 error. I've also tried DeleteBinding the other way round with ct as the parent but this recreates the 'Relational Integrity' issue. Setting ct.Trainees to null instead of calling DeleteBinding causes the 400 error to be thrown.

     

    Thanks for any help.

    Tuesday, March 11, 2008 10:53 AM
  •  

    Hmmm...the forum is not allowing me to post the metadata. It keeps complaining about an unknown error...

     

     

    Code Snippet

    <Metadata>
      <Schema Namespace="Griffin.Data" xmlns:dataWeb="http://schemas.microsoft.com/ado/2007/08/datawebhttp://schemas.microsoft.com/ado/2007/08/dataweb">http://schemas.microsoft.com/ado/2007/08/dataweb</A< A>>" xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
       '>http://schemas.microsoft.com/ado/2006/04/edm">http://schemas.microsoft.com/ado/2006/04/edm">
       ; <EntityContainer Name="GriffinDataEntities" dataWeb:IsDefaultEntityContainer="true">
          <EntitySet Name="Accounts" EntityType="Griffin.Data.Accounts" />
          <EntitySet Name="AccountsAudits" EntityType="Griffin.Data.AccountsAudits" />
          <EntitySet Name="Addresses" EntityType="Griffin.Data.Addresses" />
          <EntitySet Name="AddressesAudits" EntityType="Griffin.Data.AddressesAudits" />
          <EntitySet Name="AuditActions" EntityType="Griffin.Data.AuditActions" />
          <EntitySet Name="Audits" EntityType="Griffin.Data.Audits" />
          <EntitySet Name="Courses" EntityType="Griffin.Data.Courses" />
          <EntitySet Name="CoursesAudits" EntityType="Griffin.Data.CoursesAudits" />
          <EntitySet Name="CourseStates" EntityType="Griffin.Data.CourseStates" />
          <EntitySet Name="CourseStatesAudits" EntityType="Griffin.Data.CourseStatesAudits" />
          <EntitySet Name="CourseTrainees" EntityType="Griffin.Data.CourseTrainees" />
          <EntitySet Name="CourseTraineesAudits" EntityType="Griffin.Data.CourseTraineesAudits" />
          <EntitySet Name="CourseTypes" EntityType="Griffin.Data.CourseTypes" />
          <EntitySet Name="CourseTypesAudits" EntityType="Griffin.Data.CourseTypesAudits" />
          <EntitySet Name="Sites" EntityType="Griffin.Data.Sites" />
          <EntitySet Name="SitesAudits" EntityType="Griffin.Data.SitesAudits" />
          <EntitySet Name="Trainees" EntityType="Griffin.Data.Trainees" />
          <EntitySet Name="TraineesAudits" EntityType="Griffin.Data.TraineesAudits" />
          <AssociationSet Name="FK_Accounts_Addresses_AddressID" Association="Griffin.Data.FK_Accounts_Addresses_AddressID">
            <End Role="Addresses" EntitySet="Addresses" />
            <End Role="Accounts" EntitySet="Accounts" />
          </AssociationSet>
          <AssociationSet Name="FK_Sites_Accounts_AccountID" Association="Griffin.Data.FK_Sites_Accounts_AccountID">
            <End Role="Accounts" EntitySet="Accounts" />
            <End Role="Sites" EntitySet="Sites" />
          </AssociationSet>
          <AssociationSet Name="FK_AccountsAudits_Audits_AuditID" Association="Griffin.Data.FK_AccountsAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="AccountsAudits" EntitySet="AccountsAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_Sites_Addresses_AddressID" Association="Griffin.Data.FK_Sites_Addresses_AddressID">
            <End Role="Addresses" EntitySet="Addresses" />
            <End Role="Sites" EntitySet="Sites" />
          </AssociationSet>
          <AssociationSet Name="FK_AddressesAudits_Audits_AuditID" Association="Griffin.Data.FK_AddressesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="AddressesAudits" EntitySet="AddressesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_Audits_AuditActions_AuditActionID" Association="Griffin.Data.FK_Audits_AuditActions_AuditActionID">
            <End Role="AuditActions" EntitySet="AuditActions" />
            <End Role="Audits" EntitySet="Audits" />
          </AssociationSet>
          <AssociationSet Name="FK_CoursesAudits_Audits_AuditID" Association="Griffin.Data.FK_CoursesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="CoursesAudits" EntitySet="CoursesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_CourseStatesAudits_Audits_AuditID" Association="Griffin.Data.FK_CourseStatesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="CourseStatesAudits" EntitySet="CourseStatesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_CourseTraineesAudits_Audits_AuditID" Association="Griffin.Data.FK_CourseTraineesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="CourseTraineesAudits" EntitySet="CourseTraineesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_CourseTypesAudits_Audits_AuditID" Association="Griffin.Data.FK_CourseTypesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="CourseTypesAudits" EntitySet="CourseTypesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_SitesAudits_Audits_AuditID" Association="Griffin.Data.FK_SitesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="SitesAudits" EntitySet="SitesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_TraineesAudits_Audits_AuditID" Association="Griffin.Data.FK_TraineesAudits_Audits_AuditID">
            <End Role="Audits" EntitySet="Audits" />
            <End Role="TraineesAudits" EntitySet="TraineesAudits" />
          </AssociationSet>
          <AssociationSet Name="FK_Courses_CourseStates_CourseStateID" Association="Griffin.Data.FK_Courses_CourseStates_CourseStateID">
            <End Role="CourseStates" EntitySet="CourseStates" />
            <End Role="Courses" EntitySet="Courses" />
          </AssociationSet>
          <AssociationSet Name="FK_Courses_CourseTypes_CourseTypeID" Association="Griffin.Data.FK_Courses_CourseTypes_CourseTypeID">
            <End Role="CourseTypes" EntitySet="CourseTypes" />
            <End Role="Courses" EntitySet="Courses" />
          </AssociationSet>
          <AssociationSet Name="FK_CourseTrainees_Courses_CourseID" Association="Griffin.Data.FK_CourseTrainees_Courses_CourseID">
            <End Role="Courses" EntitySet="Courses" />
            <End Role="CourseTrainees" EntitySet="CourseTrainees" />
          </AssociationSet>
          <AssociationSet Name="FK_CourseTrainees_Trainees_TraineeID" Association="Griffin.Data.FK_CourseTrainees_Trainees_TraineeID">
            <End Role="Trainees" EntitySet="Trainees" />
            <End Role="CourseTrainees" EntitySet="CourseTrainees" />
          </AssociationSet>
          <AssociationSet Name="FK_Trainees_Sites_SiteID" Association="Griffin.Data.FK_Trainees_Sites_SiteID">
            <End Role="Sites" EntitySet="Sites" />
            <End Role="Trainees" EntitySet="Trainees" />
          </AssociationSet>
          <AssociationSet Name="AuditTrails" Association="Griffin.Data.AuditTrails">
            <End Role="NextAudits" EntitySet="Audits" />
            <End Role="PrevAudits" EntitySet="Audits" />
          </AssociationSet>
        </EntityContainer>

     

     

    Tuesday, March 11, 2008 11:10 AM
  • Maybe the forum still didn't like the line count...

     

    Code Snippet

        <EntityType Name="Accounts">
          <Key>
            <PropertyRef Name="AccountID" />
          </Key>
          <Property Name="AccountID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Addresses" Relationship="Griffin.Data.FK_Accounts_Addresses_AddressID" FromRole="Accounts" ToRole="Addresses" />
          <NavigationProperty Name="Sites" Relationship="Griffin.Data.FK_Sites_Accounts_AccountID" FromRole="Accounts" ToRole="Sites" />
        </EntityType>
        <EntityType Name="Addresses">
          <Key>
            <PropertyRef Name="AddressID" />
          </Key>
          <Property Name="AddressID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Address1" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="Address2" Type="Edm.String" Nullable="true" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="Town" Type="Edm.String" Nullable="true" MaxLength="30" Unicode="false" FixedLength="false" />
          <Property Name="County" Type="Edm.String" Nullable="true" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="Postcode" Type="Edm.String" Nullable="false" MaxLength="8" Unicode="false" FixedLength="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Accounts" Relationship="Griffin.Data.FK_Accounts_Addresses_AddressID" FromRole="Addresses" ToRole="Accounts" />
          <NavigationProperty Name="Sites" Relationship="Griffin.Data.FK_Sites_Addresses_AddressID" FromRole="Addresses" ToRole="Sites" />
        </EntityType>
        <Association Name="FK_Accounts_Addresses_AddressID">
          <End Role="Addresses" Type="Griffin.Data.Addresses" Multiplicity="0..1" />
          <End Role="Accounts" Type="Griffin.Data.Accounts" Multiplicity="*" />
        </Association>
        <EntityType Name="Sites">
          <Key>
            <PropertyRef Name="SiteID" />
          </Key>
          <Property Name="SiteID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Accounts" Relationship="Griffin.Data.FK_Sites_Accounts_AccountID" FromRole="Sites" ToRole="Accounts" />
          <NavigationProperty Name="Addresses" Relationship="Griffin.Data.FK_Sites_Addresses_AddressID" FromRole="Sites" ToRole="Addresses" />
          <NavigationProperty Name="Trainees" Relationship="Griffin.Data.FK_Trainees_Sites_SiteID" FromRole="Sites" ToRole="Trainees" />
        </EntityType>
        <Association Name="FK_Sites_Accounts_AccountID">
          <End Role="Accounts" Type="Griffin.Data.Accounts" Multiplicity="0..1" />
          <End Role="Sites" Type="Griffin.Data.Sites" Multiplicity="*" />
        </Association>
        <Association Name="FK_Sites_Addresses_AddressID">
          <End Role="Addresses" Type="Griffin.Data.Addresses" Multiplicity="0..1" />
          <End Role="Sites" Type="Griffin.Data.Sites" Multiplicity="*" />
        </Association>
        <EntityType Name="Trainees">
          <Key>
            <PropertyRef Name="TraineeID" />
          </Key>
          <Property Name="TraineeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="CourseTrainees" Relationship="Griffin.Data.FK_CourseTrainees_Trainees_TraineeID" FromRole="Trainees" ToRole="CourseTrainees" />
          <NavigationProperty Name="Sites" Relationship="Griffin.Data.FK_Trainees_Sites_SiteID" FromRole="Trainees" ToRole="Sites" />
        </EntityType>
        <EntityType Name="CourseTrainees">
          <Key>
            <PropertyRef Name="CourseID" />
            <PropertyRef Name="TraineeID" />
          </Key>
          <Property Name="CourseID" Type="Edm.Int32" Nullable="false" />
          <Property Name="TraineeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Attended" Type="Edm.Boolean" Nullable="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Courses" Relationship="Griffin.Data.FK_CourseTrainees_Courses_CourseID" FromRole="CourseTrainees" ToRole="Courses" />
          <NavigationProperty Name="Trainees" Relationship="Griffin.Data.FK_CourseTrainees_Trainees_TraineeID" FromRole="CourseTrainees" ToRole="Trainees" />
        </EntityType>
        <EntityType Name="Courses">
          <Key>
            <PropertyRef Name="CourseID" />
          </Key>
          <Property Name="CourseID" Type="Edm.Int32" Nullable="false" />
          <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" DateTimeKind="Unspecified" PreserveSeconds="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="CourseStates" Relationship="Griffin.Data.FK_Courses_CourseStates_CourseStateID" FromRole="Courses" ToRole="CourseStates" />
          <NavigationProperty Name="CourseTypes" Relationship="Griffin.Data.FK_Courses_CourseTypes_CourseTypeID" FromRole="Courses" ToRole="CourseTypes" />
          <NavigationProperty Name="CourseTrainees" Relationship="Griffin.Data.FK_CourseTrainees_Courses_CourseID" FromRole="Courses" ToRole="CourseTrainees" />
        </EntityType>
        <EntityType Name="CourseStates">
          <Key>
            <PropertyRef Name="CourseStateID" />
          </Key>
          <Property Name="CourseStateID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseState" Type="Edm.String" Nullable="false" MaxLength="15" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Courses" Relationship="Griffin.Data.FK_Courses_CourseStates_CourseStateID" FromRole="CourseStates" ToRole="Courses" />
        </EntityType>
        <Association Name="FK_Courses_CourseStates_CourseStateID">
          <End Role="CourseStates" Type="Griffin.Data.CourseStates" Multiplicity="0..1" />
          <End Role="Courses" Type="Griffin.Data.Courses" Multiplicity="*" />
        </Association>
        <EntityType Name="CourseTypes">
          <Key>
            <PropertyRef Name="CourseTypeID" />
          </Key>
          <Property Name="CourseTypeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseType" Type="Edm.String" Nullable="false" MaxLength="30" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Courses" Relationship="Griffin.Data.FK_Courses_CourseTypes_CourseTypeID" FromRole="CourseTypes" ToRole="Courses" />
        </EntityType>
        <Association Name="FK_Courses_CourseTypes_CourseTypeID">
          <End Role="CourseTypes" Type="Griffin.Data.CourseTypes" Multiplicity="0..1" />
          <End Role="Courses" Type="Griffin.Data.Courses" Multiplicity="*" />
        </Association>
        <Association Name="FK_CourseTrainees_Courses_CourseID">
          <End Role="Courses" Type="Griffin.Data.Courses" Multiplicity="1" />
          <End Role="CourseTrainees" Type="Griffin.Data.CourseTrainees" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Courses">
              <PropertyRef Name="CourseID" />
            </Principal>
            <Dependent Role="CourseTrainees">
              <PropertyRef Name="CourseID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_CourseTrainees_Trainees_TraineeID">
          <End Role="Trainees" Type="Griffin.Data.Trainees" Multiplicity="1" />
          <End Role="CourseTrainees" Type="Griffin.Data.CourseTrainees" Multiplicity="*" />
          <ReferentialConstraint>
            <Principal Role="Trainees">
              <PropertyRef Name="TraineeID" />
            </Principal>
            <Dependent Role="CourseTrainees">
              <PropertyRef Name="TraineeID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="FK_Trainees_Sites_SiteID">
          <End Role="Sites" Type="Griffin.Data.Sites" Multiplicity="0..1" />
          <End Role="Trainees" Type="Griffin.Data.Trainees" Multiplicity="*" />
        </Association>
        <EntityType Name="AccountsAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="AccountID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="AddressID" Type="Edm.Int32" Nullable="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_AccountsAudits_Audits_AuditID" FromRole="AccountsAudits" ToRole="Audits" />
        </EntityType>
        <EntityType Name="Audits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" DateTimeKind="Unspecified" PreserveSeconds="true" />
          <Property Name="UserName" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="TableName" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <NavigationProperty Name="AccountsAudits" Relationship="Griffin.Data.FK_AccountsAudits_Audits_AuditID" FromRole="Audits" ToRole="AccountsAudits" />
          <NavigationProperty Name="AddressesAudits" Relationship="Griffin.Data.FK_AddressesAudits_Audits_AuditID" FromRole="Audits" ToRole="AddressesAudits" />
          <NavigationProperty Name="AuditActions" Relationship="Griffin.Data.FK_Audits_AuditActions_AuditActionID" FromRole="Audits" ToRole="AuditActions" />
          <NavigationProperty Name="CoursesAudits" Relationship="Griffin.Data.FK_CoursesAudits_Audits_AuditID" FromRole="Audits" ToRole="CoursesAudits" />
          <NavigationProperty Name="CourseStatesAudits" Relationship="Griffin.Data.FK_CourseStatesAudits_Audits_AuditID" FromRole="Audits" ToRole="CourseStatesAudits" />
          <NavigationProperty Name="CourseTraineesAudits" Relationship="Griffin.Data.FK_CourseTraineesAudits_Audits_AuditID" FromRole="Audits" ToRole="CourseTraineesAudits" />
          <NavigationProperty Name="CourseTypesAudits" Relationship="Griffin.Data.FK_CourseTypesAudits_Audits_AuditID" FromRole="Audits" ToRole="CourseTypesAudits" />
          <NavigationProperty Name="SitesAudits" Relationship="Griffin.Data.FK_SitesAudits_Audits_AuditID" FromRole="Audits" ToRole="SitesAudits" />
          <NavigationProperty Name="TraineesAudits" Relationship="Griffin.Data.FK_TraineesAudits_Audits_AuditID" FromRole="Audits" ToRole="TraineesAudits" />
          <NavigationProperty Name="Audits1" Relationship="Griffin.Data.AuditTrails" FromRole="NextAudits" ToRole="PrevAudits" />
          <NavigationProperty Name="Audits2" Relationship="Griffin.Data.AuditTrails" FromRole="PrevAudits" ToRole="NextAudits" />
        </EntityType>

     

     

    Tuesday, March 11, 2008 11:16 AM
  • Last block.

     

    Code Snippet
    <Association Name="FK_AccountsAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="AccountsAudits" Type="Griffin.Data.AccountsAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="AccountsAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="AddressesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="AddressID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Address1" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="Address2" Type="Edm.String" Nullable="true" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="Town" Type="Edm.String" Nullable="true" MaxLength="30" Unicode="false" FixedLength="false" />
          <Property Name="County" Type="Edm.String" Nullable="true" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="Postcode" Type="Edm.String" Nullable="false" MaxLength="8" Unicode="false" FixedLength="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_AddressesAudits_Audits_AuditID" FromRole="AddressesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_AddressesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="AddressesAudits" Type="Griffin.Data.AddressesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="AddressesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="AuditActions">
          <Key>
            <PropertyRef Name="AuditActionID" />
          </Key>
          <Property Name="AuditActionID" Type="Edm.String" Nullable="false" MaxLength="1" Unicode="false" FixedLength="true" />
          <Property Name="AuditAction" Type="Edm.String" Nullable="false" MaxLength="10" Unicode="false" FixedLength="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_Audits_AuditActions_AuditActionID" FromRole="AuditActions" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_Audits_AuditActions_AuditActionID">
          <End Role="AuditActions" Type="Griffin.Data.AuditActions" Multiplicity="1" />
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="*" />
        </Association>
        <EntityType Name="CoursesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseTypeID" Type="Edm.Int32" Nullable="true" />
          <Property Name="CourseStateID" Type="Edm.Int32" Nullable="true" />
          <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" DateTimeKind="Unspecified" PreserveSeconds="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_CoursesAudits_Audits_AuditID" FromRole="CoursesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_CoursesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="CoursesAudits" Type="Griffin.Data.CoursesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="CoursesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="CourseStatesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseStateID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseState" Type="Edm.String" Nullable="false" MaxLength="15" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_CourseStatesAudits_Audits_AuditID" FromRole="CourseStatesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_CourseStatesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="CourseStatesAudits" Type="Griffin.Data.CourseStatesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="CourseStatesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="CourseTraineesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseID" Type="Edm.Int32" Nullable="false" />
          <Property Name="TraineeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="Attended" Type="Edm.Boolean" Nullable="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_CourseTraineesAudits_Audits_AuditID" FromRole="CourseTraineesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_CourseTraineesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="CourseTraineesAudits" Type="Griffin.Data.CourseTraineesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="CourseTraineesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="CourseTypesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseTypeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="CourseType" Type="Edm.String" Nullable="false" MaxLength="30" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_CourseTypesAudits_Audits_AuditID" FromRole="CourseTypesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_CourseTypesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="CourseTypesAudits" Type="Griffin.Data.CourseTypesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="CourseTypesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="SitesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="SiteID" Type="Edm.Int32" Nullable="false" />
          <Property Name="AccountID" Type="Edm.Int32" Nullable="true" />
          <Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="50" Unicode="false" FixedLength="false" />
          <Property Name="AddressID" Type="Edm.Int32" Nullable="true" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_SitesAudits_Audits_AuditID" FromRole="SitesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_SitesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="SitesAudits" Type="Griffin.Data.SitesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="SitesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <EntityType Name="TraineesAudits">
          <Key>
            <PropertyRef Name="AuditID" />
          </Key>
          <Property Name="AuditID" Type="Edm.Int32" Nullable="false" />
          <Property Name="TraineeID" Type="Edm.Int32" Nullable="false" />
          <Property Name="SiteID" Type="Edm.Int32" Nullable="true" />
          <Property Name="FirstName" Type="Edm.String" Nullable="false" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="LastName" Type="Edm.String" Nullable="false" MaxLength="20" Unicode="false" FixedLength="false" />
          <Property Name="RowVersion" Type="Edm.Binary" Nullable="false" MaxLength="8" FixedLength="true" />
          <Property Name="GUID" Type="Edm.Guid" Nullable="false" />
          <NavigationProperty Name="Audits" Relationship="Griffin.Data.FK_TraineesAudits_Audits_AuditID" FromRole="TraineesAudits" ToRole="Audits" />
        </EntityType>
        <Association Name="FK_TraineesAudits_Audits_AuditID">
          <End Role="Audits" Type="Griffin.Data.Audits" Multiplicity="1" />
          <End Role="TraineesAudits" Type="Griffin.Data.TraineesAudits" Multiplicity="0..1" />
          <ReferentialConstraint>
            <Principal Role="Audits">
              <PropertyRef Name="AuditID" />
            </Principal>
            <Dependent Role="TraineesAudits">
              <PropertyRef Name="AuditID" />
            </Dependent>
          </ReferentialConstraint>
        </Association>
        <Association Name="AuditTrails">
          <End Role="NextAudits" Type="Griffin.Data.Audits" Multiplicity="*" />
          <End Role="PrevAudits" Type="Griffin.Data.Audits" Multiplicity="*" />
        </Association>
      </Schema>
    </Metadata>

     

     

     

    Tuesday, March 11, 2008 11:17 AM
  • As a temporary work around I now detach the entity to be deleted, retrieve it using CreateQuery and then delete that entity. This goes through without any errors being thrown as LoadProperty is not being called.

     

    I'm guessing it has something to do with the bindings and how they are being manipulated by the WebDataContext when deleting an item.

    Wednesday, March 12, 2008 4:13 PM
  • Hi KSid,

     

    we have made a number of bug fixes to our support for tracking bindings.  If you can can you give things a spin with the latest interim release of Astoria (now part of .NET Framework 3.5 SP1 Beta 1) : http://www.microsoft.com/downloads/details.aspx?FamilyId=8C36ACA4-E947-4760-9B05-93CAC04C6F87&displaylang=en

     

    Wednesday, June 18, 2008 5:08 AM