Esempio n. 1
0
        // Admin
        public PagedListDto <UserWithRolesDto> MapToUserWithRolesDto(PagedListData <Ssuser> pl)
        {
            var items = pl.Select(
                u => new UserWithRolesDto()
            {
                Id       = u.Id,
                UserName = u.UserName,
                Roles    = u.SsuserRole.Select(r => r.Role.ToString()).ToList(),  // is this right?? 062820/070620/070920
            }).ToList();

            var pldto = new PagedListDto <UserWithRolesDto>(items)
            {
                TotalItems   = pl.TotalItems,
                ItemsPerPage = pl.ItemsPerPage,
                CurrentPage  = pl.CurrentPage,
                TotalPages   = pl.TotalPages
            };

            return(pldto);
        }
Esempio n. 2
0
        // Artist
        public PagedListDto <ArtistForListDto> MapToArtistForListDto(PagedListData <Artist> pl)
        {
            var artists = pl.Select(a => new ArtistForListDto
            {
                Id             = a.ArtistId,
                Name           = a.ArtistName,
                ArtistStatusId = a.ArtistStatusId,
                YearsActive    = ArtistCalculations.CalculateArtistYearsActive(a.CareerBeginDate, a.CareerEndDate),
                ArtistGroup    = a.ArtistGroup,
                UserId         = a.UserId,
                Verified       = a.Verified,
                HomeCity       = GetHomeCity(a)
            }).ToList();

            var pldto = new PagedListDto <ArtistForListDto>(artists)
            {
                TotalItems   = pl.TotalItems,
                ItemsPerPage = pl.ItemsPerPage,
                CurrentPage  = pl.CurrentPage,
                TotalPages   = pl.TotalPages
            };;

            return(pldto);
        }