0
I have found it difficult to solve the following problem: Assuming I have the following structure in the database:
Id int identity primary key
CodigoBanco char(3)
Descricao varchar(100)
Endereco varchar(300)
Bairro varchar(100)
CodCidade int
Numero varchar(10)
Complemento varchar(15)
DataInclusao datetime
DataAlteracao datetime
UsrAlteracao int
Observacao varchar(3000)
However, the system has 3 views:
View1 - You need the Id and Description fields to fill in a dropdownlist;
View2 - You need the fields Id, Codigobanco, Descricao, Endereco, Bairro, Codcidade, Numero;
View3 - Needs all the fields;
With the Entity Framework, my approach has been to return a Iqueryable from the repository and make the Select in the Controller as needed.
But this is not possible when we are using Procedure + ADO.NET (Not by my will).
What would be the best approach?
Create a precedent and a class for each situation?
Create a precedent for each situation using the same class (even with partial filling of properties)?
Disregard the data traffic and always bring all the columns, and so, developing only a Procedure?