Beispiel #1
0
        public async Task <Unit> Handle(AddNewSubscriberCommand ARequest, CancellationToken ACancellationToken)
        {
            var NewGuid = Guid.NewGuid();
            await FCosmosDbService.AddItem(NewGuid, new Subscribers
            {
                Id    = NewGuid,
                Email = ARequest.Email
            }, ACancellationToken);

            return(await Task.FromResult(Unit.Value));
        }
        public async Task <Unit> Handle(AddNewArticleCommand ARequest, CancellationToken ACancellationToken)
        {
            var NewGuid = Guid.NewGuid();
            await FCosmosDbService.AddItem(NewGuid, new Articles
            {
                Id        = ARequest.Id,
                Title     = ARequest.Title,
                Desc      = ARequest.Desc,
                Status    = ARequest.Status,
                Likes     = ARequest.Likes,
                ReadCount = ARequest.ReadCount
            }, ACancellationToken);

            return(await Task.FromResult(Unit.Value));
        }