예제 #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
 public TeclynApi(ITeclynApiConfiguration _)
 {
     this.Configuration = _;
 }
예제 #3
0
 public static void AddSample(this IServiceCollection services, ITeclynApiConfiguration configuration)
 {
     services.AddTeclyn(new TeclynApi(configuration));
 }