Esempio n. 1
0
        public ListDto GetList(int id, string userId)
        {
            if (!_listRepository.IsMember(id, userId))
            {
                return(null);
            }

            var list   = _listRepository.GetList(id);
            var result = _mapper.Map <ListDto>(list);

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <ListDTO> GetList(string ProjectID)
        {
            List <TblList> Lists    = (List <TblList>)_listRepository.GetList(ProjectID);
            List <ListDTO> listsDTO = new List <ListDTO>();

            foreach (TblList list in Lists)
            {
                ListDTO listdto = _mapper.Map <ListDTO>(list);
                listsDTO.Add(listdto);
            }
            return(listsDTO);
        }
        public async Task <ActionResult <ListRessource> > GetList(int id, bool includeTasks = true)
        {
            try
            {
                // userName is not working ;/
                var userName = this.User.Identity.Name;
                if (this.User.Identity.IsAuthenticated && userName != null)
                {
                    var result = await _listRepository.GetList(id, true);

                    //return _mapper.Map<ListRessource>(result);
                    var ressource = _mapper.Map <ListRessource>(result);
                    return(ressource);
                }
                else
                {
                    return(this.StatusCode(StatusCodes.Status401Unauthorized, "Unauthorized request"));
                }
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }
Esempio n. 4
0
 public List <List> GetList()
 {
     return(listRepository.GetList());
 }
Esempio n. 5
0
 public Result <IEnumerable <TModel> > GetList()
 {
     return(EntityToModel(Repository.GetList()));
 }
Esempio n. 6
0
 public override void Shutdown()
 {
     _entityLoader.WriteToFile(_localPlaylistRepository.GetList(), PlaylistFile);
 }
Esempio n. 7
0
 public TList GetList(string userId, int idList)
 {
     return(_listRepository.GetList(userId, idList));
 }
Esempio n. 8
0
 public ToDoList GetList(int id)
 {
     return(_listRepo.GetList(id));
 }