Sivakumar

Sivakumar

  • NA
  • 551
  • 210.2k

How to implement web api passing two parameters

Aug 28 2015 3:01 AM
Hi ,
i have a web api like this :
public class CardsController : ApiController
{
[Route("{teamId}/metrics/{memberId}")]
public List<CardData> GetCards(int teamId,int memberId)
{
//Send the list of cards associated with the team. Also send member previous rating and team average rating of past 7 days
throw new NotImplementedException();
}
in that given a teamId and memberId it goes to the Vote table and gets last Voted value and last Vote date time and card details also
this is my CardData Model :
public class CardData
{
public int CardID { get; set; }
public string CardName { get; set; }
public string CardDescription { get; set; }
public CardRatingData CardRating { get; set; }
}
and this is CardRatingData Model :
public class CardRatingData
{
public int MemberPreviousRating { get; set; }
public DateTime MemberPreviousRatingDateTime { get; set; }
public double TeamAverage7DayRating { get; set; }
}
this is my tables structure :
 
 in that i want to implement using linq to sql stored procedure
 
please give a code for that.
 
thank you.
 
 

Answers (6)