Example #1
0
 public object ContentList(ContentListSongster contentList)
 {
     if (contentList.PortalCode == "stk")
     {
         var listOfContents = _context.Database.SqlQuery <sp_GetContentList_Result>("sp_GetContentList_stk").ToList();
         return(Ok(listOfContents));
     }
     else if (contentList.PortalCode == "sb")
     {
         var listOfContents = _context.Database.SqlQuery <sp_GetContentList_Sb1_Result>("EXEC sp_GetContentList_Sb").ToList();
         return(Ok(listOfContents));
     }
     else if (contentList.PortalCode == "lp")
     {
         var listOfContents = _hoiChoiEntities.Database.SqlQuery <sp_GetGameData_Result>("EXEC sp_GetGameData").ToList();
         return(Ok(listOfContents));
     }
     else if (contentList.PortalCode == "song")
     {
         // var listOfContents = MySqlList();
         return(Ok());
     }
     else
     {
         var listOfContents = _context.Database.SqlQuery <sp_GetContentList_Result>("sp_GetContentList @portalcode,@catcode",
                                                                                    new SqlParameter("@portalcode", contentList.PortalCode ?? "123"),
                                                                                    new SqlParameter("@catcode", contentList.CatCode ?? "123")
                                                                                    ).ToList();
         return(Ok(listOfContents));
     }
 }
Example #2
0
        public object ContentListSongster(ContentListSongster contentList)
        {
            var uid            = contentList.Uid;
            var caption        = contentList.Caption;
            var listOfContents = MySqlList(uid, caption);

            return(Ok(listOfContents));

            return(Ok());
        }