locked
Asp.net WebForms + Dependecy Injection + Unity + Entity Framework RRS feed

  • Question

  • I am
    having problem understanding how Dependecy Injection + Unity + Entity Framework
    can decouple UI (Asp.net WebForms).  I understand that I need to create t4 template to
    force EF to create interfaces for entityobjects  but can someone explain how to decouple
    Asp.net GridView control from all other layers when GridView needs to display Person data from
    Person database table which has let's say just two columns FirstName and LastName. Would not I still
    have to reference  IPerson intreface from aspx code file  in order to bind GridView to List<IPerson> regardless if I use Dependecy Injection container or not ?

    The way I see it, this does not really matter if UI depends on IPerson. or directly on Person
    because it still depends on external layer. If I need to add SSN field to Person table later on that will
    still trigger a chain of changes all the way to UI Gridview because I would probably need to change CSS design to support new column.

    So why use Dependency Injection + Unity for this scenario ?

     

     

     

     

     

     

     

     

    Tuesday, June 21, 2011 9:01 PM

All replies

  • Worng Direction ...... in technical decision making.

    Do look into ASP.NET MVC 4.0 with entity framework 4.0. For control in mvc asp.net 4.0 do contact Microsoft directly.

     

    Wednesday, June 22, 2011 5:06 AM