开发者

do we still need bindingsource when there is entity framework

开发者 https://www.devze.com 2023-02-18 05:06 出处:网络
entity framework plays a role as ORM in between the underlying datasource and UI controls, i\'m wondering do we still need to use bindingsource on top of EF?

entity framework plays a role as ORM in between the underlying datasource and UI controls, i'm wondering do we still need to use bindingsource on top of EF?

e.g. can i just bind

datagridv开发者_JAVA百科iew.DataSource = entity.getdata();

instead of

bindingsource.DataSource = entity.etdata();
this.datagridview.DataSource = this.bindingsource;


Obviously you can directly bind the datasource of the Gridview to the entity result.
But what about following scenarios:

  1. Having multiple controls attaching to the same datasource, e.g. List+Detail
  2. Navigating in code-behind through the datasource.
    Can be done using "ugly" CurrencyManager but is much nicer through the bindingsource

More here bindingsource "Remarks" section in MSDN

0

精彩评论

暂无评论...
验证码 换一张
取 消