entity framework using stored procedure :
entity framework using stored procedure :
[Route("Messages/{Id:long}")]
public class MessageList
{
public long Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int msgCount { get; set; }
}
public dynamic Get(long Id)
{
List<MessageList> msgList = new List<MessageList>();
var messageList =
//exec storedprocedure name and passed paramaters
Db.Database.SqlQuery<MessageList>("Exec getUserMessageList @userId " ,new SqlParameter("@userId",Id));
msgList = messageList.ToList();
}
No comments:
Post a Comment