Exemplo n.º 1
0
    public List <FavoriteContent> GetFavoriteContent(int userID, int contentTypeID, int groupID, bool isRestricted)
    {
        int _userID = SueetieContext.Current.User.UserID;

        if (userID == -2)
        {
            userID = _userID;
        }

        var favorites = from f in SueetieUsers.GetFavoriteContentList(userID)
                        orderby f.Title
                        where f.ContentTypeID == contentTypeID && f.GroupID == groupID
                        select f;

        if (isRestricted)
        {
            return(favorites.Where(f => f.IsRestricted == false).ToList());
        }
        else
        {
            return(favorites.ToList());
        }
    }