public async Task <bool> ReadMessageAsync([FromBody] OaMessageReadDto message) { message.UserId = UserIdentity.UserId; var res = await _messageService.ReadMessageAsync(message); return(res); }
public async Task <bool> ReadMessageAsync(OaMessageReadDto message) { var uri = API.OaMessage.ReadMessageAsync(_baseUrl); var content = new StringContent(JsonConvert.SerializeObject(message), System.Text.Encoding.UTF8, "application/json"); var response = await _apiClient.PostAsync(uri, content); response.EnsureSuccessStatusCode(); string res = await response.Content.ReadAsStringAsync(); return(res.ToLower() == bool.TrueString.ToLower()); }
public async Task <bool> ReadMessageAsync(OaMessageReadDto message) { var dbmessageUser = await _databaseFixture.Db.OaMessageUser.FindAsync(m => m.MessageId == message.MessageId && m.UserId == message.UserId); if (dbmessageUser != null) { dbmessageUser.IsRead = 1; await _databaseFixture.Db.OaMessageUser.UpdateAsync(dbmessageUser); return(true); } else { return(false); } }
public async Task <bool> ReadMessageAsync([FromBody] OaMessageReadDto message) { return(await _messageService.ReadMessageAsync(message)); }