I have the following information in Json:
[
{
"$id": "1",
"Cditemcontacli": 1.0,
"Cdcontacli": 1.0,
"Descricao": "Produto 1"
},
{
"$id": "2",
"Cditemcontacli": 2.0,
"Cdcontacli": 2.0,
"Descricao": "Produto 2"
},
{
"$id": "3",
"Cditemcontacli": 3.0,
"Cdcontacli": 2.0,
"Descricao": "Produto 3"
},
{
"$id": "4",
"Cditemcontacli": 4.0,
"Cdcontacli": 3.0,
"Descricao": "Produto 4"
}]
Controller:
//GET: api/Itemcontaclis/5
[ResponseType(typeof(Itemcontacli))]
public async Task<IHttpActionResult> GetItemcontacli(decimal id)
{
Itemcontacli itemcontacli = await db.Itemcontacli.FindAsync(id);
if (itemcontacli == null)
{
return NotFound();
}
return Ok(itemcontacli);
}
Api web config:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{Action}/{id}",
defaults: new { id = RouteParameter.Optional }
I want to bring only those who have Cdcontacli:2.0
.
If you look at Cdcontacli:2.0
it repeats itself. Is it possible to find the two together somehow?
Thank you.