小编fso*_*o94的帖子

在 RedHat Linux Enterprise Developer Workstation 上编译 C++17 代码

我四处搜索,找不到在 Red Hat Enterprise Linux 7.5 Developer Workstation 上编译 c++17 源代码的明确方法。

我已经能够使用以下命令在 Fedora 上成功编译 C++17 源代码:

g++ -std=c++1z main.cpp -o main

我在我的 Red Hat 工作站上尝试了同样的事情,并收到一条消息,指出 g++ -std=c++1z 不是一个可识别的命令。

任何帮助或指导表示赞赏。

c++ linux redhat c++17

4
推荐指数
2
解决办法
2808
查看次数

Netbeans 8.0.2输出窗口

我想将输出窗口颜色从默认的白色更改为黑色或其他颜色.我使用的是Netbeans 8.0.2 IDE.

background-color netbeans-8

3
推荐指数
1
解决办法
7321
查看次数

如何在 ASP.NET Core 2.0 Web API 中配置和使用 Microsoft.AspNetCore.JsonPatch

我正在我的 ASP.NET Web API 控制器中创建一个 HTTP Partial 方法,我阅读了这个文档http://benfoster.io/blog/aspnet-core-json-patch-partial-api-updates关于如何实现 HTTP Partial 方法在控制器中。当我点击 HTTP Partial 端点时出现异常在此处输入图片说明

这是我的控制器中 Patch 方法的代码:

[HttpPatch("{userId}")]
public IActionResult Patch([FromRoute(Name = "userId")]Guid userId, [FromBody] JsonPatchDocument<User> userProperties)
{
    var indexOfUserToPartiallyUpdate = UsersInMemory.List.FindIndex(user => user.Id == userId);

    if (indexOfUserToPartiallyUpdate == -1)
    {
        return BadRequest($"user with {userId} not found.");
    }

    var originalUser = UsersInMemory.List[indexOfUserToPartiallyUpdate];

    userProperties.ApplyTo(UsersInMemory.List[indexOfUserToPartiallyUpdate], ModelState);

    if (!ModelState.IsValid)
    {  
        return new BadRequestObjectResult(ModelState);
    }

    var model = new
    {
        beforePatch = originalUser,
        afterPatch = UsersInMemory.List[indexOfUserToPartiallyUpdate]
    };

    return Ok(model);
}
Run Code Online (Sandbox Code Playgroud)

这是我在 HTTP …

c# asp.net json json.net

2
推荐指数
1
解决办法
1376
查看次数

标签 统计

asp.net ×1

background-color ×1

c# ×1

c++ ×1

c++17 ×1

json ×1

json.net ×1

linux ×1

netbeans-8 ×1

redhat ×1