private static UserResponse ToResponse(UserDocument user) { return (new UserResponse { Id = user.Id, Name = user.Name, Version = Environment.GetEnvironmentVariable("APP_VERSION"), Host = Environment.MachineName }); }
public async Task <UserResponse> Post([FromBody] CreateUserRequest request) { var user = new UserDocument { Id = Guid.NewGuid().ToString("N"), Name = request.Name }; await this.users.InsertOneAsync(user); return(ToResponse(user)); }