示例#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);
        }
示例#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"));
            }
        }
示例#4
0
 public List <List> GetList()
 {
     return(listRepository.GetList());
 }
示例#5
0
 public Result <IEnumerable <TModel> > GetList()
 {
     return(EntityToModel(Repository.GetList()));
 }
 public override void Shutdown()
 {
     _entityLoader.WriteToFile(_localPlaylistRepository.GetList(), PlaylistFile);
 }
示例#7
0
 public TList GetList(string userId, int idList)
 {
     return(_listRepository.GetList(userId, idList));
 }
示例#8
0
 public ToDoList GetList(int id)
 {
     return(_listRepo.GetList(id));
 }