Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CandidateTest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="RestSharp" Version="110.2.0" />
</ItemGroup>

</Project>
36 changes: 36 additions & 0 deletions Post.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System;

namespace CandidateTest
{
public class Post
{
public string github_username { get; set; }
public string short_greeting { get; set; }
public string email { get; set; }
public string name { get; set; }
public RandomNumber random_number { get; set; }
public bool is_test { get; set; }

public Post()
{
github_username = "";
short_greeting = "";
email = "";
name = "";
random_number = new RandomNumber();
is_test = false;
}
}

public class RandomNumber
{
public int number { get; set; }
public string reason { get; set; }

public RandomNumber()
{
number = 0;
reason = "";
}
}
}
48 changes: 48 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using RestSharp;

namespace CandidateTest
{
class Program
{
static void Main(string[] args)
{
Random random = new Random();
int randomNumber = random.Next(10, 1001);
Console.WriteLine(randomNumber);

string url = "https://flow.zoho.com/663067151/flow/webhook/incoming?zapikey=1001.72d0b18a4316a1acc8f0de7fa7dbdf74.4f792bf21ebf81a4d04112d94177a2a1&isdebug=false";
var client = new RestClient(url);
var request = new RestRequest();

var body = new Post
{
github_username = "Hoanghuyen2k3",
short_greeting = "Thank you for the opportunity and I am looking forward to discussing more",
email = "khanhhuyenx20@gmail.com",
name = "Thi Huyen Hoang",
random_number = new RandomNumber
{
number = randomNumber,
reason = "This is a random number generated by the Random function."
},
is_test = false
};

request.AddJsonBody(body);
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(body));

var response = client.Post(request);
if (response != null)
{
Console.WriteLine(response.StatusCode.ToString() + " " + response.Content.ToString());
}
else
{
Console.WriteLine("The response object is null.");
}

Console.Read();
}
}
}
80 changes: 80 additions & 0 deletions bin/Debug/net8.0/CandidateTest.deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"CandidateTest/1.0.0": {
"dependencies": {
"Newtonsoft.Json": "13.0.3",
"RestSharp": "110.2.0"
},
"runtime": {
"CandidateTest.dll": {}
}
},
"Newtonsoft.Json/13.0.3": {
"runtime": {
"lib/net6.0/Newtonsoft.Json.dll": {
"assemblyVersion": "13.0.0.0",
"fileVersion": "13.0.3.27908"
}
}
},
"RestSharp/110.2.0": {
"dependencies": {
"System.Text.Json": "7.0.2"
},
"runtime": {
"lib/net7.0/RestSharp.dll": {
"assemblyVersion": "110.2.0.0",
"fileVersion": "110.2.0.0"
}
}
},
"System.Text.Encodings.Web/7.0.0": {},
"System.Text.Json/7.0.2": {
"dependencies": {
"System.Text.Encodings.Web": "7.0.0"
}
}
}
},
"libraries": {
"CandidateTest/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Newtonsoft.Json/13.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
"path": "newtonsoft.json/13.0.3",
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
},
"RestSharp/110.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-FXGw0IMcqY7yO/hzS9QrD3iNswNgb9UxJnxWmfOxmGs4kRlZWqdtBoGPLuhlbgsDzX1RFo4WKui8TGGKXWKalw==",
"path": "restsharp/110.2.0",
"hashPath": "restsharp.110.2.0.nupkg.sha512"
},
"System.Text.Encodings.Web/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-OP6umVGxc0Z0MvZQBVigj4/U31Pw72ITihDWP9WiWDm+q5aoe0GaJivsfYGq53o6dxH7DcXWiCTl7+0o2CGdmg==",
"path": "system.text.encodings.web/7.0.0",
"hashPath": "system.text.encodings.web.7.0.0.nupkg.sha512"
},
"System.Text.Json/7.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/LZf/JrGyilojqwpaywb+sSz8Tew7ij4K/Sk+UW8AKfAK7KRhR6mKpKtTm06cYA7bCpGTWfYksIW+mVsdxPegQ==",
"path": "system.text.json/7.0.2",
"hashPath": "system.text.json.7.0.2.nupkg.sha512"
}
}
}
Binary file added bin/Debug/net8.0/CandidateTest.dll
Binary file not shown.
Binary file added bin/Debug/net8.0/CandidateTest.exe
Binary file not shown.
Binary file added bin/Debug/net8.0/CandidateTest.pdb
Binary file not shown.
12 changes: 12 additions & 0 deletions bin/Debug/net8.0/CandidateTest.runtimeconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}
Binary file added bin/Debug/net8.0/Newtonsoft.Json.dll
Binary file not shown.
Binary file added bin/Debug/net8.0/RestSharp.dll
Binary file not shown.
76 changes: 76 additions & 0 deletions obj/CandidateTest.csproj.nuget.dgspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"format": 1,
"restore": {
"C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\CandidateTest.csproj": {}
},
"projects": {
"C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\CandidateTest.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\CandidateTest.csproj",
"projectName": "CandidateTest",
"projectPath": "C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\CandidateTest.csproj",
"packagesPath": "C:\\Users\\Thi Huyen Hoang\\.nuget\\packages\\",
"outputPath": "C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Thi Huyen Hoang\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"Newtonsoft.Json": {
"target": "Package",
"version": "[13.0.3, )"
},
"RestSharp": {
"target": "Package",
"version": "[110.2.0, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.204/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
15 changes: 15 additions & 0 deletions obj/CandidateTest.csproj.nuget.g.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Thi Huyen Hoang\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.9.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Thi Huyen Hoang\.nuget\packages\" />
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions obj/CandidateTest.csproj.nuget.g.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)system.text.json\7.0.2\buildTransitive\net6.0\System.Text.Json.targets" Condition="Exists('$(NuGetPackageRoot)system.text.json\7.0.2\buildTransitive\net6.0\System.Text.Json.targets')" />
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
Empty file.
22 changes: 22 additions & 0 deletions obj/Debug/net8.0/CandidateTest.AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("CandidateTest")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1d5ff9e9649cd6431cb6e540705942ae6441851b")]
[assembly: System.Reflection.AssemblyProductAttribute("CandidateTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("CandidateTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

1 change: 1 addition & 0 deletions obj/Debug/net8.0/CandidateTest.AssemblyInfoInputs.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
68c810ce2fb396350bd4a0ff25caba41e0b5b78c4c3e4fd9360f8045ce480043
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = CandidateTest
build_property.ProjectDir = C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
8 changes: 8 additions & 0 deletions obj/Debug/net8.0/CandidateTest.GlobalUsings.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;
Binary file added obj/Debug/net8.0/CandidateTest.assets.cache
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d96a89d3d965f65150f0fb68d30a4222202a52348cc4119e4bc13f2c36739b87
19 changes: 19 additions & 0 deletions obj/Debug/net8.0/CandidateTest.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.AssemblyInfoInputs.cache
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.AssemblyInfo.cs
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.csproj.CoreCompileInputs.cache
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.sourcelink.json
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\CandidateTest.exe
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\CandidateTest.deps.json
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\CandidateTest.runtimeconfig.json
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\CandidateTest.dll
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\CandidateTest.pdb
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\Newtonsoft.Json.dll
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\bin\Debug\net8.0\RestSharp.dll
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.csproj.AssemblyReference.cache
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\Candidat.ADE18942.Up2Date
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.dll
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\refint\CandidateTest.dll
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.pdb
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\CandidateTest.genruntimeconfig.cache
C:\Users\Thi Huyen Hoang\Documents\program\C#\CandidateTest\obj\Debug\net8.0\ref\CandidateTest.dll
Binary file added obj/Debug/net8.0/CandidateTest.dll
Binary file not shown.
1 change: 1 addition & 0 deletions obj/Debug/net8.0/CandidateTest.genruntimeconfig.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1a26daff9c7b578b3d9f819c827cf94df40b761883addde2ea36ef2c231fc997
Binary file added obj/Debug/net8.0/CandidateTest.pdb
Binary file not shown.
1 change: 1 addition & 0 deletions obj/Debug/net8.0/CandidateTest.sourcelink.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"documents":{"C:\\Users\\Thi Huyen Hoang\\Documents\\program\\C#\\CandidateTest\\*":"https://raw.githubusercontent.com/Hoanghuyen2k3/CandidateTest/1d5ff9e9649cd6431cb6e540705942ae6441851b/*"}}
Binary file added obj/Debug/net8.0/apphost.exe
Binary file not shown.
Binary file added obj/Debug/net8.0/ref/CandidateTest.dll
Binary file not shown.
Binary file added obj/Debug/net8.0/refint/CandidateTest.dll
Binary file not shown.
Loading