Jordan MJordan M

My feedback

  1. 274 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      Jordan MJordan M commented  · 

      Do people realise that you can make the default contructor protected?

      Same goes for properties - you can make the setter protected.

    • 666 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        Jordan MJordan M commented  · 

        I have already commented on this once, so apologies for the spam - but every time I come back to this it seems worse.

        I know there is plenty of code around where people are accessing their DbContext directly in the service or UI layers of their applications where this wouldn't be so much of an issue.

        But.... if you have properly wrapped Entity Framework up in your data access layer this gets really annoying. It means you end up having to create a DAO for every entity that you might possibly need to delete. Normally I would only have DAOs for the main entities in my application, and manage their children via the collections hanging off them.

        Please fix this.

        Jordan MJordan M supported this idea  · 
        Jordan MJordan M commented  · 

        This is a must have feature. I cannot believe that Entity Framework hasn't got this, This gives NHibernate a simple but significant advantage.

        This is an ORM - the O stands for "Object" and one of the *main* benefits of using an ORM is that as much as possible it should allow you to do object oriented programming. Automatically syncing trees of objects to the database is a massive part of that.

        If a collection of an entities makes up part of its parent, if one of those objects is removed from its parents collection then it should be deleted from the database. You shouldn't have to then go and delete it again using a call to your data access layer.

      • 205 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          6 comments  ·  Entity Framework Feature Suggestions » runtime  ·  Flag idea as inappropriate…  ·  Admin →
          Jordan MJordan M commented  · 

          I wouldn't have static methods on the entities themselves, this goes against the way the framework is currently designed.

          I would add methods to the DbContext or DbSet<TEntity>, something similar to Keith Barrows suggestion.

        Feedback and Knowledge Base