Exemple #1
0
        public async Task UpdatePhoto(UpdatePhotoReq req, DatabaseContext context)
        {
            var expertProfile = await context.ExpertProfiles
                                .Include(p => p.User)
                                .SingleAsync(profile => profile.Id == req.ExpertProfileId);

            expertProfile.PhotoImageUrl     = req.PhotoUrl;
            expertProfile.ThumbnailImageUrl = req.PhotoUrl;

            if (expertProfile.IsPublished)
            {
                this.ThrowIfPublishingBroken(expertProfile);
            }
        }
Exemple #2
0
        public async Task UpdatePhoto(UpdatePhotoReq req, DatabaseContext context)
        {
            var currentUserData = this._currentUserService.GetCurrentUserData();

            var e = await context.Events
                    .SingleAsync(ee => ee.Id == req.EventId && ee.Company.UserId == currentUserData.Id);

            e.LogoImageUrl = req.PhotoUrl;

            if (e.IsPublished)
            {
                this.ThrowIfPublishingBroken(e);
            }
        }
Exemple #3
0
        public async Task UpdatePhoto(UpdatePhotoReq req, DatabaseContext context)
        {
            var currentUserData = this._currentUserService.GetCurrentUserData();

            var company = await context.Companies
                          .SingleAsync(c => c.Id == req.CompanyId && c.UserId == currentUserData.Id);

            company.LogoImageUrl = company.ThumbnailImageUrl = req.PhotoUrl;

            if (company.IsPublished)
            {
                this.ThrowIfPublishingBroken(company);
            }
        }