zikalol
zikalol
CC#
Created by zikalol on 3/15/2023 in #help
❔ .net 7 custom filters from query params
Hello, what is the best practice to do filters depends on the params i send from the frontend What i have guessed is to make a model for what filters i can send. is is the right thing to do or there is another generic way to do it ? Any advices are appreciated I need help
2 replies
CC#
Created by zikalol on 11/22/2022 in #help
❔ ❔ Better way to map object
Hello guys, i have an object called Room and it have building,floor,zone data
Data im getting
class room {
buildingProp1
buildingProp2
FloorProp1
ZoneProp1
Roomprop3
Roomprop4
}
//i want to generate multiple classes like that

//building
class row1 {
buildingprop1
buildingprop2
FloorProp1 = null
ZoneProp1 = null
Roomprop3 = null
Roomprop4 = null
}
//Floor
class row2{
buildingprop1
buildingprop2
FloorProp1
ZoneProp1 = null
Roomprop3 = null
Roomprop4 = null
}
//Zone
class row3{
buildingprop1
buildingprop2
FloorProp1
ZoneProp1
Roomprop3 = null
Roomprop4 = null
}
//room
class row4 {
buildingProp1
buildingProp2
FloorProp1
ZoneProp1
Roomprop3
Roomprop4
}
Data im getting
class room {
buildingProp1
buildingProp2
FloorProp1
ZoneProp1
Roomprop3
Roomprop4
}
//i want to generate multiple classes like that

//building
class row1 {
buildingprop1
buildingprop2
FloorProp1 = null
ZoneProp1 = null
Roomprop3 = null
Roomprop4 = null
}
//Floor
class row2{
buildingprop1
buildingprop2
FloorProp1
ZoneProp1 = null
Roomprop3 = null
Roomprop4 = null
}
//Zone
class row3{
buildingprop1
buildingprop2
FloorProp1
ZoneProp1
Roomprop3 = null
Roomprop4 = null
}
//room
class row4 {
buildingProp1
buildingProp2
FloorProp1
ZoneProp1
Roomprop3
Roomprop4
}
PS: ofc i rows 4 inherits row 3 and row 3 inherits row 2 etc.. i have done it with automapper I autoMap all rows to the row4 class then i aggregate the list to a tuple that contains lists of row 1 row 2 row 3 then i map them again to row4 class then i add them to the original list. Is there any better way to do it ? i have used aggregate to just generate all data with one loop
4 replies
CC#
Created by zikalol on 11/3/2022 in #help
What is the best practice for large data insertion and updates
Hello, I have kind of large data that I'm getting from external API. I need to insert this data in my database and update it nightly with a cron job. i'd like to know what's the best practice to do it
8 replies