How to deal with many possible values to make a query?

后端 未结 3 1844
囚心锁ツ
囚心锁ツ 2021-01-23 03:06

I\'m building an MVC app in which the user will have the possibilities of using a lot of filters to get exactly what he wants.

Here\'s an overview of those filters based

3条回答
  •  广开言路
    2021-01-23 03:43

    Ho do you normally face this in JavaScript ? You would create an option object, like

    var op = {
       cardName : "..",
       cardType : "" ,
        ...
    }
    

    and pass it to a function. Correct ?

    The same do in C# too. Define a, say, Conditions class, like

    public class Conditions {
        public string CardName {get;set;}
        public string CardType {get;set;}
        .. 
    }
    

    and pass it to your function, which controls the values of the properties of that type to act accordingly after.

提交回复
热议问题