コード例 #1
0
        public ImageViewModel(Image i)
        {
            this.Image = i;

            Keywords = Image.Keywords.ToList().Select(k => new TranslatedViewModel<Keyword, KeywordTranslation>(k))
                            .ToList();

            Classification = new TranslatedViewModel<Classification, ClassificationTranslation>(Image.Classification);

            Specimens = Image.Specimens.ToList().Select(s => new TranslatedViewModel<Specimen, SpecimenTranslation>(s))
                             .ToList();
        }
コード例 #2
0
        public ImageEditViewModel(Image i)
        {
            this.Image = i;

            AvailableKeywords = new List<SelectListItem>();

            AvailableDocuments = new List<SelectListItem>
            {
                new SelectListItem { Selected = true, Text = "" }
            };

            AvailableClassifications = new List<SelectListItem>
            {
                new SelectListItem { Selected = true, Text = "" }
            };

            KeywordIds = i.Keywords.Select(k => k.Id).ToArray();
        }