Ejemplo 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;
        }