Пример #1
0
        public virtual ActionResult Create(long fanPageId)
        {
            var lb = Repository.GetUnique<LocalBusiness>(
                l => l.FanPageId == fanPageId);

            /* not authenticating user \ demanding him to be owner of
             * localbusiness since localbusiness may not yet exit, and user
             * might haven't logged in */

            var playlistDTO = new PlaylistDTO
                    {
                        LocalBusinessId = (lb != null) ? lb.Id : -1,
                        FanPageId = fanPageId,
                        IsActive = true,
                        PublishAdminContentToWall = (lb == null) || lb.PublishAdminContentToWall,
                        PublishUserContentToWall = (lb == null) || lb.PublishUserContentToWall,
                        NumOfSongsLimit = 5 //TODO: set this magic string in some config file
                    };

            var playlistWithUserDTO = new PlaylistWithUserDTO
                {
                    Playlist = playlistDTO,
                    User = BuildUserDTO(null) //no playlist created yet
                };

            return View(MVC.Settings.Views.Create, playlistWithUserDTO);
        }
Пример #2
0
 public static Playlist ReverseMap(PlaylistDTO pdto)
 {
     return Mapper.Map<PlaylistDTO, Playlist>(pdto);
 }