what is Entity Framework with POCO

后端 未结 4 1017
Happy的楠姐
Happy的楠姐 2020-12-13 02:25

What is the benefit of using POCO? I don\'t understand the meaning of Persistence Ignorance, what does this mean? That the poco object can\'t expose things like Save? I can\

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 03:04

    POCO = Plain old CLR Objects.

    Plain old CLR (i.e. C# or VB) objects means I can speak C# or VB the whole time I am writing my program, and not have to worry about esoteric database language like

    UPDATE MYTABLE SET MYFIELD1 = @MYPARAMETER1, MYFIELD2 = @MYPARAMETER2 BLAH BLAH
    

    EF Generated entities == POCO connected (indirectly) to a database.

提交回复
热议问题