private MediaModel PrepareListMediaModel(MediaModel media)
 {
     media.Actions.Add(new DeleteActionLink(media.Id, Search, Page));
     return media;
 }
        public static MediaModel ToModel(this Media entity)
        {
            if (entity == null)
                return null;

            var model = new MediaModel
            {
                EntityId = entity.EntityId,
                EntityType = entity.EntityType,
                EntityTypeId = entity.EntityTypeId,
                FileName = entity.FileName,
                FileType = entity.FileType,
                FileTypeId = entity.FileTypeId,
                Id = entity.Id,
                Link = entity.Link,
                Name = entity.Name,
                UploadedById = entity.UploadedById,
                UploadedDate = entity.UploadedDate
            };

            return model;
        }