Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kevon K. Hayes 255 posts 281 karma points
    Jan 11, 2012 @ 03:44
    Kevon K. Hayes
    0

    Using Entity Framework 4 with ApplicationBase

    UMB 4.7.1
    EF4

    I'm using EF to remove a record from the database on "Document.BeforeDelete" and I'm getting this error:

    The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

    This error is errorneous as I do reference the System.Data.Entity assembly in my project.

     

  • Kevon K. Hayes 255 posts 281 karma points
    Jan 11, 2012 @ 04:37
    Kevon K. Hayes
    0

    I was able to resolve the above issue by adding this reference <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> to the <compilation><assemblies> section in the web.config.

    however the Document
    .BeforeDelete event doesn't see to be firing.

    Any insight?

  • Markus Johansson 1902 posts 5706 karma points MVP c-trib
    Jan 11, 2012 @ 06:02
    Markus Johansson
    1

    The event should always fire do you have any code to show?

  • Markus Johansson 1902 posts 5706 karma points MVP c-trib
    Jan 11, 2012 @ 06:10
    Markus Johansson
    0

    The event should always fire do you have any code to show?

  • Kevon K. Hayes 255 posts 281 karma points
    Jan 11, 2012 @ 13:07
    Kevon K. Hayes
    0

    The Document.MoveToTrash event is what I shoild have handled.  As this event fires first.

Please Sign in or register to post replies

Write your reply to:

Draft