Simple Data Access Layer

后端 未结 9 576
野趣味
野趣味 2021-02-06 17:33

Can anyone suggest a simple Data Access Layer (C# .NET)? Not keen on using the Microsoft Application Data Access block, seems very bloated and overkill. Also don\'t want to use

9条回答
  •  误落风尘
    2021-02-06 18:01

    For very simple requirements (and I mean simple!) I'd create a DAL based on the repository pattern, where the sql querying is done in the repository methods and then simple POCO's (Plain old CLR objects) are created and returned.

    You can call sprocs or parametized SQL if required. Then map the data to your poco (for this just use a standard SQLDataReader)

    But to be honest the moment the queries get big or complex or there are lots of fields in your objects you're better off letting a proper DAL/ORM take the strain and concentrate on your application.

提交回复
热议问题