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)); }
public IActionResult Put(Guid id, [FromBody] CreateSunscribeDTO value) { var client = _authService.GetCurrentClient(this.User); return(Ok(_subscribesService.Update(id, value, client))); }
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)); }
public IActionResult Post([FromBody] CreateSunscribeDTO value) { var client = _authService.GetCurrentClient(this.User); return(Ok(_subscribesService.Add(value, client))); }