linq with unassigned variable parameters

前端 未结 3 982
孤独总比滥情好
孤独总比滥情好 2021-01-15 03:10

I have the following variable declarations at the top of my main function

string brand;
double price;
var itemList6 = from i in myStore.items
    where i.pri         


        
3条回答
  •  梦毁少年i
    2021-01-15 03:59

    You could write a function and pass those variables as parameters to avoid intialization..

    Also in case you end up initializing consider using ?? in order to avoid nulls.

提交回复
热议问题