Dynamic linq query with multiple/unknown criteria

前端 未结 3 1042
醉酒成梦
醉酒成梦 2020-12-01 22:26

I am looking to implement a system whereby a use that \'build\' conditions and then return the resulting data back from the database. At present, there is a stored procedure

3条回答
  •  情话喂你
    2020-12-01 22:48

    This can be simply done by Linq where you attach additional operators to the query object. Here is an example.

    query = db.Contacts.Where( ... );
     query = query.Where( ... );
     query = query.Where( ... );
    

    This is a more simpler and short solution.

提交回复
热议问题