Sivakumar

Sivakumar

  • NA
  • 551
  • 217.8k

how to implement web api using linq to sql

Aug 28 2015 4:06 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 (1)