base = { base: 'base', prop: '897070980989'}; ingr_mapArray.push(base); protien = { protein: 'protein', prop: '452341342453'}; ingr_mapArray.puh(protein);
I want to get ingr_mapArray in C#. And wants to store in a List<‘Ingrediants>. How can I get this array?
This is how you should go about it
Then where you need the list you do
In your example, the
base
object has a property"base"
, and similarlyprotien
has"protien"
which is not something you can do in the same class. So I named itType
where you can provide eitherbase
orprotien
.