コード例 #1
0
 public static void AddBlog(this IServiceCollection services, ITeclynApiConfiguration configuration)
 {
     services.AddTeclyn(new TeclynApi(configuration)
                        .AddDomain <UserDomain>(d => d
                                                .AddCommand <RegisterUserCommand, RegisterUserCommandHandler>()
                                                .AddAggregate <IUser>(a => a
                                                                      .AddEvent <Registered>()))
                        .AddDomain <PostDomain>(d => d
                                                .AddCommand <CreatePostAsDraft, CreatePostAsDraftCommandHandler>()
                                                .AddCommand <PublishPost, PublishPostCommandHandler>()
                                                .AddCommand <UpdatePostText, UpdatePostTextCommandHandler>()
                                                .AddCommand <UpdatePostTitle, UpdatePostTitleCommandHandler>()
                                                .AddQuery <ListPosts, ListPostsQueryHandler, IEnumerable <IPost> >()
                                                .AddAggregate <IPost>(a => a
                                                                      .AddEvent <CreatedAsDraft>()
                                                                      .AddEvent <Published>()
                                                                      .AddEvent <TextUpdated>()
                                                                      .AddEvent <TitleUpdated>())));
 }
コード例 #2
0
ファイル: TeclynApi.cs プロジェクト: klejeune/teclyn
 public TeclynApi(ITeclynApiConfiguration _)
 {
     this.Configuration = _;
 }
コード例 #3
0
 public static void AddSample(this IServiceCollection services, ITeclynApiConfiguration configuration)
 {
     services.AddTeclyn(new TeclynApi(configuration));
 }