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 populate a dropdownlist;
View2 - You need the Id fields, Bank Code, Description, Address, Neighborhood, CodCity, Number
View3 - Need all fields;
With the Entity Framework, my approach has been to return an IQueryable from the repository and make the Select on 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 procedure and a class for each situation?
Create a procedure for each situation using the same class (even if partial filling of properties)?
Disregard data traffic and always bring all columns, and thus only developing a procedure?