jeudi 6 octobre 2022

Is it okay to convert a result dataset in database layer

I'm working on an ASP.NET MVC project in C# with an N-tier architecture.

A class (EmployeeRepo) in the database project has many functions.
Each function's natural result from the transaction is a dataset, but they are converted as per the need.

The return types are:

  • Dataset (with one or more tables)
  • DataTable
  • int
  • bool
  • Object (single employee)
  • List<Object> (list of employees)

Which is better among the two or is there a standard to follow:

  1. Return the result as is without any conversion. The conversion should only happen at other layer and not in the database layer.
  2. It is okay to convert the result in this layer before returning.

Aucun commentaire:

Enregistrer un commentaire