public async Task <ActionResult> MarkMyPrivateMessageAsReadAsync([FromRoute] Guid MessageId) { if (MessageId == Guid.Empty) { return(BadRequest()); } var result = await _privateMessageService.MarkPrivateMessageAsReadAsync(MessageId, _apiPrincipal.Uid); return(result.HasValue ? (ActionResult)Json(result) : BadRequest()); }
public async Task <ActionResult> MarkMyPrivateMessageAsReadAsync( [EnsureNotNull][FromRoute] Guid MessageId, [EnsureNotNull][FromBody] bool IsRead ) { if (!IsRead) { return(BadRequest("Message can only be marked as read; not as unread.")); } var result = await _privateMessageService.MarkPrivateMessageAsReadAsync(MessageId, _apiPrincipal.Uid); return(result.HasValue ? (ActionResult)Json(result) : BadRequest()); }