Data Access Layer returns DataTable

后端 未结 1 782
深忆病人
深忆病人 2020-12-22 01:16

Please have a look at the following question, which i asked some time ago: Breaking BLL (Business Logic Layer) to BLL and DAL (Data Access Layer)

This approach (Data

相关标签:
1条回答
  • 2020-12-22 01:24

    Returning a DataTable isn't completely terrible--there's certainly worse ways of doing it--it's only partly terrible. But, who wants to eat partly terrible food unless they have no other option?

    So, unless there's some reason why you need to use a DataTable, I would recommend sticking with custom DTO classes and just have your DAL return a list of those objects. For instance:

    Public Function GetNames() As List(Of NameDto)
        '...
    End Function
    
    0 讨论(0)
提交回复
热议问题