コード例 #1
0
        public Task Update(Guid id, CreateSunscribeDTO value, Client client)
        {
            var subscribeModel = new Subscribe(id, client.ClientId, value.ConnectionId, value.StartEventNumber, DateTime.UtcNow, true);

            var oldConnection = _subscribeRepository.GetById(id);

            if (oldConnection == null)
            {
                throw new ArgumentNullException();
            }

            return(_subscribeRepository.UpdateAsync(subscribeModel));
        }
コード例 #2
0
        public IActionResult Put(Guid id, [FromBody] CreateSunscribeDTO value)
        {
            var client = _authService.GetCurrentClient(this.User);

            return(Ok(_subscribesService.Update(id, value, client)));
        }
コード例 #3
0
        Task <Subscribe> ISubscribesService.Add(CreateSunscribeDTO createSubscribe, Client client)
        {
            var subscribeModel = new Subscribe(Guid.NewGuid(), client.ClientId, createSubscribe.ConnectionId, createSubscribe.StartEventNumber, DateTime.UtcNow, true);

            return(_subscribeRepository.InsertAsync(subscribeModel));
        }
コード例 #4
0
        public IActionResult Post([FromBody] CreateSunscribeDTO value)
        {
            var client = _authService.GetCurrentClient(this.User);

            return(Ok(_subscribesService.Add(value, client)));
        }