Exemplo n.º 1
0
        public List<API_List> GetUserLists(string userPublicKey)
        {
            var rcList = new List<API_List>();
            try
            {
                //
                using (_dataAccess = new DataMethods())
                {
                    var usr = _dataAccess.User_GetUser(userPublicKey);
                    if (usr != null)
                    {
                        var converter = new API_List();
                        var usrLists = _dataAccess.List_GetListByUserID(usr.UserID);
                        foreach (var l in usrLists)
                        {
                            rcList.Add(converter.ConvertToAPI_ListWithAllItems(l));
                        }
                    }
                    else
                    {
                        throw new Exception("Unable to source User: " + userPublicKey);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return rcList;
        }
Exemplo n.º 2
0
        /// <summary>
        /// This will convert the internal ListShare to a API version with the associated List object
        /// </summary>
        /// <param name="listShare"></param>
        /// <returns></returns>
        public API_ListShare ConvertToAPI_ListShareWithAssociatedList(GyftoList.Data.ListShare listShare)
        {
            var apiShare = GetShellListShare(listShare);
            var apiList = new API_List();
            apiShare.SharedList = apiList.ConvertToAPI_ListWithAllItems(listShare.List);

            return apiShare;
        }