Beispiel #1
0
 public GalleryController(ILogger <GalleryController> logger,
                          IGalleryReadRepository readModel,
                          IFamilyEventReadRepository familyEventReadRepository,
                          IWriteRepository <Repo.Core.Model.Gallery, Guid> galleryWriteModel,
                          IWriteRepository <Repo.Core.Model.ImageReference, Guid> imageReferenceWriteModel,
                          IImageReferenceReadRepository imageReferenceReadRepository,
                          IFileService fileService,
                          ClanAndPeopleService clanAndPeopleService,
                          ContextService contextService)
     : base("Galleries", "gallery")
 {
     _logger    = logger;
     _readModel = readModel;
     _familyEventReadRepository = familyEventReadRepository;
     _writeModel = galleryWriteModel;
     _imageReferenceWriteModel     = imageReferenceWriteModel;
     _imageReferenceReadRepository = imageReferenceReadRepository;
     _fileService          = fileService;
     _clanAndPeopleService = clanAndPeopleService;
     _contextService       = contextService;
 }
Beispiel #2
0
 public EventController(IFamilyEventReadRepository readmodel,
                        IWriteRepository <Repo.Core.Model.FamilyEvent, Guid> writeModel,
                        IImageReferenceReadRepository imageReferenceReadRepository,
                        IGalleryReadRepository galleryReadRepository,
                        ContextService contextService,
                        IWriteRepository <Repo.Core.Model.Gallery, Guid> galleryWriteRepository,
                        IFileService fileService,
                        IWriteRepository <Repo.Core.Model.ImageReference, Guid> imageReferenceWriteModel,
                        ISesService sesServive,
                        ClanAndPeopleService clanAndPeopleService)
     : base("Significant Events", "events")
 {
     _readmodel  = readmodel;
     _writeModel = writeModel;
     _imageReferenceReadRepository = imageReferenceReadRepository;
     _galleryReadRepository        = galleryReadRepository;
     _contextService           = contextService;
     _galleryWriteRepository   = galleryWriteRepository;
     _fileService              = fileService;
     _imageReferenceWriteModel = imageReferenceWriteModel;
     _sesServive           = sesServive;
     _clanAndPeopleService = clanAndPeopleService;
 }
Beispiel #3
0
        public static async Task <GalleryIndex> Map(Repo.Core.Model.Gallery sourceGallery, ClanAndPeopleService clanAndFamilyService, IFamilyEventReadRepository familyEventReadModel, CancellationToken cancellationToken)
        {
            var familyName = sourceGallery.FamilyId.HasValue ?
                             $"{clanAndFamilyService.Clans.FirstOrDefault(c => c.Id == sourceGallery.FamilyId)?.FamilyName}, {clanAndFamilyService.Clans.FirstOrDefault(c => c.Id == sourceGallery.FamilyId)?.Family}"
                                : string.Empty;

            return(await Task.FromResult(new GalleryIndex()
            {
                Title = sourceGallery.Name,
                FamilyEvent = FamilyEvent.Map(await familyEventReadModel.Load(sourceGallery.FamilyEvent, cancellationToken)),
                Owner = sourceGallery.Owner.ToString(),
                OwnerId = sourceGallery.Owner,
                Summary = sourceGallery.Summary,
                Id = sourceGallery.ID,
                DateCreated = sourceGallery.DateCreated,
                Family = familyName,
                DefaultFamilyEventGallery = sourceGallery.DefaultFamilyEventGallery,
                GalleryDate = sourceGallery.GalleryDate,
                Clan = clanAndFamilyService.Clans.FirstOrDefault(t => t.Id == sourceGallery.FamilyId)
            }
                                         ));
        }