//Constructors
 #region Details
 public Details(Persistence.Garage garages)
 {
     this.Guid           = garages.Guid;
     this.Date           = garages.CreateTimeStamp;
     this.Title          = garages.Title;
     this.GaragePictures = garages.GaragePictures
                           .OrderBy(runner => runner.SortOrder)
                           .Select(runner => new GaragePictureViewModel(runner));
 }
Beispiel #2
0
                //Constructors
                #region GarageViewModel
                public GarageViewModel(Persistence.Garage garage)
                {
                    this.Guid  = garage.Guid;
                    this.Title = garage.Title;

                    var teaser = garage.GaragePictures
                                 .OrderBy(runner => runner.SortOrder)
                                 .Select(runner => runner.Picture)
                                 .FirstOrDefault();

                    this.TeaserPictureGuid = teaser?.Guid;
                }
            //Constructor
            #region Preview
            public Preview(Persistence.Garage garage)
            {
                this.Guid  = garage.Guid;
                this.Title = garage.Title;
                this.Date  = garage.CreateTimeStamp;

                var teaser = garage.GaragePictures.OrderBy(runner => runner.SortOrder).FirstOrDefault();

                if (teaser != null)
                {
                    this.TextTeaser      = String.Concat(teaser.Text.Take(300).ToList()) + "...";
                    this.TeaserImageGuid = teaser.PictureGuid;
                }
            }