How to create a dynamic model C#

Viewed 64

I am trying to create a model for a stored procedure, but my stored procedure uses temporal tables and it depends in the data that you sent it will respond you with more results:

enter image description here

enter image description here

So the result can have a lot of rows depend on the years that you specify.

I will be glad if anyone has an idea of how to create the model that can have all the records by not hard-coding it. Thanks by the way

1 Answers

I believe that the ideal in this case is to create another table, it is not at all performative to create several fields dynamically, see an example.

create table title (
    id int primary key identity,
    nombre varchar(100)
)

create table monthh (
    id          int primary key identity,
    id_title    int  foreign key references title,
    dayy            tinyint,        --9
    monn            char(3),        --Feb
    val             money           --0.00
)
Related