Changes between Version 1 and Version 2 of AdvancedApplicationDevelopment
- Timestamp:
- 08/24/26 17:09:39 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedApplicationDevelopment
v1 v2 11 11 if (existing != null) 12 12 throw new InvalidOperationException("Email already in use."); 13 14 13 await using var transaction = await _context.BeginTransactionAsync(cancellationToken); 15 14 try … … 25 24 UpdatedAt = DateTime.UtcNow 26 25 }; 27 28 26 await _userRepository.AddAsync(user, cancellationToken); 29 30 var writer = new Domain.Entities.Writer { Id = user.Id }; 27 var writer = new Domain.Entities.Writer 28 { 29 Id = user.Id, 30 Bio = request.Bio 31 }; 31 32 await _writerRepository.AddAsync(writer, cancellationToken); 32 33 33 await transaction.CommitAsync(cancellationToken); 34 34 return new RegisterResponse(user.Id, user.Username, user.Email); … … 52 52 var story = new Domain.Entities.Story 53 53 { 54 Title = request.Title, 54 55 MatureContent = request.MatureContent, 55 56 ShortDescription = request.ShortDescription, 56 57 Image = request.Image, 57 58 Content = request.Content, 59 Status = "draft", 58 60 UserId = request.UserId, 59 61 CreatedAt = DateTime.UtcNow, 60 62 UpdatedAt = DateTime.UtcNow 61 63 }; 62 63 64 await _storyRepository.AddAsync(story, cancellationToken); 64 65 65 foreach (var genreName in request.Genres ?? []) 66 66 { … … 69 69 await _hasGenreRepository.AddAsync(new Domain.Entities.HasGenre { StoryId = story.Id, GenreId = genre.Id }, cancellationToken); 70 70 } 71 72 71 await transaction.CommitAsync(cancellationToken); 73 72 return new AddResponse(story.Id); … … 80 79 } 81 80 }}} 82 83 81 == Database Connection Pooling == 84 82
