Commit 567e6f12 authored by datdiep's avatar datdiep

init

parents
Pipeline #15835 canceled with stages
File added

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UF.AssessmentProject", "UF.AssessmentProject\UF.AssessmentProject.csproj", "{26CF07E4-59E3-4B7D-A923-629953248052}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{BA60F2BF-4169-4ECA-AA46-412EB686848C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{26CF07E4-59E3-4B7D-A923-629953248052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26CF07E4-59E3-4B7D-A923-629953248052}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26CF07E4-59E3-4B7D-A923-629953248052}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26CF07E4-59E3-4B7D-A923-629953248052}.Release|Any CPU.Build.0 = Release|Any CPU
{BA60F2BF-4169-4ECA-AA46-412EB686848C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA60F2BF-4169-4ECA-AA46-412EB686848C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA60F2BF-4169-4ECA-AA46-412EB686848C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA60F2BF-4169-4ECA-AA46-412EB686848C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D00067A6-C897-4B77-B326-D709E14F9F73}
EndGlobalSection
EndGlobal
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UF.AssessmentProject.Controllers;
using Xunit;
namespace TestProject1
{
public class ControllerTest
{
private readonly TransactionController _controller;
public ControllerTest(TransactionController controller)
{
_controller = controller;
}
[Fact]
public void add_transaction()
{
var rq = new UF.AssessmentProject.Model.Transaction.RequestMessage()
{
partnerkey = "FAKEGOOGLE",
partnerpassword = "FG-00001",
partnerrefno = "RkFLRVBBU1NXT1JEMTIzNA==",
sig = "24XYSmvKGH9I9Y5FLvSsId2MPtjkvog7U5JLhE3m30A=",
timestamp = "2013-11-22T02:11:22.0000000Z",
totalamount = 1000,
items = new List<UF.AssessmentProject.Model.Transaction.itemdetail>()
{
new UF.AssessmentProject.Model.Transaction.itemdetail()
{
name = "i-00001",
partneritemref = "Pen",
qty = 5,
unitprice = 2
},
new UF.AssessmentProject.Model.Transaction.itemdetail()
{
name = "i-00002",
partneritemref = "Ruler",
qty = 1,
unitprice = 100
}
}
};
var createdResponse = _controller.SubmitTRansaction(rq);
Assert.IsType<CreatedAtActionResult>(createdResponse);
}
}
}
using System;
using System.Collections.Generic;
using Xunit;
namespace TestProject1
{
public class Fake
{
public readonly List<UF.AssessmentProject.Model.Transaction.RequestMessage> _requestMessage = new List<UF.AssessmentProject.Model.Transaction.RequestMessage>();
public void Test1()
{
var rq = new UF.AssessmentProject.Model.Transaction.RequestMessage()
{
partnerkey = "FAKEGOOGLE",
partnerpassword = "FG-00001",
partnerrefno= "RkFLRVBBU1NXT1JEMTIzNA==",
sig = "2013-11-22T02:11:22.0000000Z",
timestamp = "2013-11-22T02:11:22.0000000Z",
totalamount= 1000,
items = new List<UF.AssessmentProject.Model.Transaction.itemdetail>()
{
new UF.AssessmentProject.Model.Transaction.itemdetail()
{
name = "i-00001",
partneritemref = "Pen",
qty = 5,
unitprice = 2
},
new UF.AssessmentProject.Model.Transaction.itemdetail()
{
name = "i-00002",
partneritemref = "Ruler",
qty = 1,
unitprice = 100
}
}
};
_requestMessage.Add(rq);
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UF.AssessmentProject\UF.AssessmentProject.csproj" />
</ItemGroup>
</Project>
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
File added
{
"format": 1,
"restore": {
"G:\\meu\\UF\\TestProject1\\TestProject1.csproj": {}
},
"projects": {
"G:\\meu\\UF\\TestProject1\\TestProject1.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "G:\\meu\\UF\\TestProject1\\TestProject1.csproj",
"projectName": "TestProject1",
"projectPath": "G:\\meu\\UF\\TestProject1\\TestProject1.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\",
"outputPath": "G:\\meu\\UF\\TestProject1\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net5.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"projectReferences": {
"G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj": {
"projectPath": "G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"dependencies": {
"Microsoft.NET.Test.Sdk": {
"target": "Package",
"version": "[16.9.4, )"
},
"coverlet.collector": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[3.0.2, )"
},
"xunit": {
"target": "Package",
"version": "[2.4.1, )"
},
"xunit.extensibility.core": {
"target": "Package",
"version": "[2.4.1, )"
},
"xunit.runner.visualstudio": {
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
"suppressParent": "All",
"target": "Package",
"version": "[2.4.3, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.406\\RuntimeIdentifierGraph.json"
}
}
},
"G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj",
"projectName": "UF.AssessmentProject",
"projectPath": "G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\",
"outputPath": "G:\\meu\\UF\\UF.AssessmentProject\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net5.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"dependencies": {
"Microsoft.AspNetCore.Authentication.JwtBearer": {
"target": "Package",
"version": "[5.0.1, )",
"noWarn": [
"NU1605"
]
},
"Microsoft.AspNetCore.Authentication.OpenIdConnect": {
"target": "Package",
"version": "[5.0.1, )",
"noWarn": [
"NU1605"
]
},
"Microsoft.EntityFrameworkCore.InMemory": {
"target": "Package",
"version": "[5.0.0, )"
},
"Microsoft.Extensions.Logging.Log4Net.AspNetCore": {
"target": "Package",
"version": "[6.1.0, )"
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[13.0.1, )"
},
"Swashbuckle.AspNetCore": {
"target": "Package",
"version": "[5.6.3, )"
},
"Swashbuckle.AspNetCore.Annotations": {
"target": "Package",
"version": "[5.6.3, )"
},
"log4net": {
"target": "Package",
"version": "[2.0.14, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.406\\RuntimeIdentifierGraph.json"
}
}
}
}
}
\ No newline at end of file
<?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\Admin\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Admin\.nuget\packages\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.visualstudio.props" Condition="Exists('$(NuGetPackageRoot)xunit.runner.visualstudio\2.4.3\build\netcoreapp2.1\xunit.runner.visualstudio.props')" />
<Import Project="$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.props" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.testplatform.testhost\16.9.4\build\netcoreapp2.1\Microsoft.TestPlatform.TestHost.props" Condition="Exists('$(NuGetPackageRoot)microsoft.testplatform.testhost\16.9.4\build\netcoreapp2.1\Microsoft.TestPlatform.TestHost.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\16.9.4\build\netstandard1.0\Microsoft.CodeCoverage.props" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\16.9.4\build\netstandard1.0\Microsoft.CodeCoverage.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\16.9.4\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\16.9.4\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Pkgxunit_analyzers Condition=" '$(Pkgxunit_analyzers)' == '' ">C:\Users\Admin\.nuget\packages\xunit.analyzers\0.10.0</Pkgxunit_analyzers>
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\Admin\.nuget\packages\microsoft.extensions.apidescription.server\3.0.0</PkgMicrosoft_Extensions_ApiDescription_Server>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.targets" Condition="Exists('$(NuGetPackageRoot)xunit.core\2.4.1\build\xunit.core.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.codecoverage\16.9.4\build\netstandard1.0\Microsoft.CodeCoverage.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.codecoverage\16.9.4\build\netstandard1.0\Microsoft.CodeCoverage.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\16.9.4\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\16.9.4\build\netcoreapp2.1\Microsoft.NET.Test.Sdk.targets')" />
<Import Project="$(NuGetPackageRoot)coverlet.collector\3.0.2\build\netstandard1.0\coverlet.collector.targets" Condition="Exists('$(NuGetPackageRoot)coverlet.collector\3.0.2\build\netstandard1.0\coverlet.collector.targets')" />
</ImportGroup>
</Project>
\ No newline at end of file
This diff is collapsed.
using log4net.Core;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Swashbuckle.AspNetCore.Annotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using UF.AssessmentProject.Helper;
using UF.AssessmentProject.logs;
using UF.AssessmentProject.Providers;
namespace UF.AssessmentProject.Controllers
{
[Produces("application/json"),
Route("api/[action]"),
ApiController]
[SwaggerTag("Transaction Middleware Controller to keep transactional data in Log Files")]
public class TransactionController : ControllerBase
{
private readonly HomeProvider _homeProvider = new HomeProvider();
private readonly ILoggerManager _logger;
public TransactionController(ILoggerManager logger)
{
_logger = logger;
}
/// <summary>
/// Submit Transaction data
/// </summary>
/// <remarks>
/// Ensure all parameter needed and responded as per IDD
/// Ensure all posible validation is done
/// API purpose: To ensure all data is validated and only valid partner with valid signature are able to access to this API
/// </remarks>
/// <param name="req">language:en-US(English), ms-MY(BM)</param>
/// <returns></returns>
///
[HttpPut]
[SwaggerResponse(StatusCodes.Status200OK, "Submit Transaction Message successfully", typeof(Model.Transaction.ResponseMessage))]
[SwaggerResponse(StatusCodes.Status401Unauthorized, "Unauthorized, Request")]
[SwaggerResponse(StatusCodes.Status500InternalServerError, "Oops! Can't get your Post right now")]
[SwaggerResponse(StatusCodes.Status400BadRequest, Type = typeof(Model.Transaction.ResponseMessage))]
[ProducesResponseType(typeof(Model.Transaction.ResponseMessage), 400)]
public ActionResult<Model.Transaction.ResponseMessage> SubmitTRansaction(Model.Transaction.RequestMessage req)
{
try {
Model.Transaction.ResponseMessage results = new Model.Transaction.ResponseMessage();
results.success = 0;
// Your Code here
results = _homeProvider.Validate(req);
_logger.LogInformation(Request.Path.ToString() + "\r\nRequest = " + JsonConvert.SerializeObject(req));
if (results.success == DataDictionary.responseResult.failed)
_logger.LogError(Request.Path.ToString() + "\r\nResponse =" + JsonConvert.SerializeObject(results));
else
_logger.LogInformation(Request.Path.ToString() + "\r\nResponse =" + JsonConvert.SerializeObject(results));
return Ok(results);
}
catch (Exception ex)
{
var error = new Model.Transaction.ResponseMessage { resultmessage = ex.Message };
return new JsonResult(new { success = false, message = "Unexpected Error" });
}
}
/// <summary>
/// Test this controller is active
/// </summary>
/// <remarks>
/// Test API to check API is Alive or not
/// </remarks>
/// <returns></returns>
[HttpGet]
public ActionResult<string> TestAPI()
{
string result = "Hello World!";
return Ok(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace UF.AssessmentProject.Helper
{
public static class CommonUtils
{
public static string ComputeSha256Hash(string rawData)
{
// Create a SHA256
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(rawData));
// Convert byte array to a string
StringBuilder builder = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
return builder.ToString();
}
}
public static string EncodeBase64(string rawData)
{
return Convert.ToBase64String(Encoding.UTF8.GetBytes(rawData));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace UF.AssessmentProject.Helper
{
public class DataDictionary
{
/// <summary>
/// response Result
/// failed = 0,
/// success = 1,
/// pending = 2
/// </summary>
public enum responseResult
{
/// <summary>
/// Failed
/// </summary>
failed = 0,
success = 1
}
}
}
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace UF.AssessmentProject.Model.Partner
{
[Keyless]
public class Partner
{
[StringLength(50, ErrorMessage = "Name length can't be more than 50.")]
public string partnerkey { get; set; }
public string partnerpassword { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using UF.AssessmentProject.Helper;
namespace UF.AssessmentProject.Model
{
public class RequestMessage
{
public string partnerkey { get; set; }
public string partnerpassword { get; set; }
public string sig { get; set; }
/// <summary>
/// Time in the ISO format. ie. 2014-04-14T12:34:23.00+0800 Preferdably set using RealTimeStamp instead.
/// </summary>
/// <example>2020-07-28T12:34:23.00+0800</example>
/// <returns></returns>
// [Required]
public string timestamp
{
get { return _realTimeStamp.ToUniversalTime().ToString("o"); }
set { _realTimeStamp = DateTime.Parse(value, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.RoundtripKind); }
}
private DateTime _realTimeStamp;
/// <summary>
/// When this field is set, automatically converts to the string
/// for the timestamp property
/// </summary>
/// <remarks>Internal use</remarks>
[Newtonsoft.Json.JsonIgnore()]
[System.Text.Json.Serialization.JsonIgnore()]
public DateTime RealTimeStamp
{
get { return _realTimeStamp; }
}
}
}

using System;
using System.ComponentModel.DataAnnotations;
using UF.AssessmentProject.Helper;
namespace UF.AssessmentProject.Model
{
public class ResponseMessage
{
/// <summary>
/// Response Result
/// </summary>
/// <example>1</example>
[Required]
public DataDictionary.responseResult success { get; set; }
/// <summary>
/// Error Messages Description
/// </summary>
/// <example>Success</example>
[Required]
public string resultmessage { get; set; }
}
}
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace UF.AssessmentProject.Model.Transaction
{
[Keyless]
public class RequestMessage : Model.RequestMessage
{
public string partnerrefno { get; set; }
public long totalamount { get; set; }
public List<itemdetail> items { get; set; }
}
[Keyless]
public class itemdetail
{
public string partneritemref { get; set; }
public string name { get; set; }
public int qty { get; set; }
public long unitprice { get; set; }
}
public class ResponseMessage: Model.ResponseMessage
{
}
}
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UF.AssessmentProject.Model;
namespace UF.AssessmentProject.Model
{
public class dbContext : DbContext
{
public DbSet<UF.AssessmentProject.Model.Partner.Partner> Partners { get; set; }
public dbContext(DbContextOptions<dbContext> options) : base(options)
{
LoadData();
}
public void LoadData()
{
UF.AssessmentProject.Model.Partner.Partner p1 = new Partner.Partner { partnerkey = "FAKEGOOGLE", partnerpassword = "FAKEPASSWORD1234" };
UF.AssessmentProject.Model.Partner.Partner p2 = new Partner.Partner { partnerkey = "FAKEPEOPLE", partnerpassword = "FAKEPASSWORD4578" };
Partners.Add(p1);
Partners.Add(p2);
// List<UF.AssessmentProject.Model.Transaction.itemdetail> lstitem = new List<Transaction.itemdetail>();
// lstitem.Add(new Transaction.itemdetail { name = "Pen", partneritemref = "i-00001", qty = 10, unitprice = 1 });
// lstitem.Add(new Transaction.itemdetail { name = "Ruler", partneritemref = "i-00002", qty = 100, unitprice = 2 });
// UF.AssessmentProject.Model.Transaction.RequestMessage r1 = new Transaction.RequestMessage
// {
// partnerkey = "FAKEGOOGLE",
// partnerrefno = "FG-00001",
// totalamount = 100,
// items = lstitem,
// partnerpassword = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("1234")),
// sig = System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes("2013-11-22T02:11:22.0000000ZFAKEGOOGLEFG-00001100xxx"))
//};
// RequestMessages.Add(r1);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<UF.AssessmentProject.Model.Partner.Partner>( e => {
e.HasKey(k => k.partnerkey);
});
base.OnModelCreating(modelBuilder);
}
}
}
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace UF.AssessmentProject
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52386",
"sslPort": 44302
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"UF.AssessmentProject": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": "true",
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UF.AssessmentProject.Helper;
namespace UF.AssessmentProject.Providers
{
public class HomeProvider : baseProvider
{
public Model.Transaction.ResponseMessage validateField(Model.Transaction.RequestMessage req)
{
var resultmess = "";
if (req.partnerkey == null)
resultmess += "partnerkey is required!, ";
if (req.partnerrefno == null)
resultmess += "partnerrefno is required!, ";
if (req.timestamp == null)
resultmess += "timestamp is required!, ";
if (req.sig == null)
resultmess += "sig is required!, ";
if(resultmess.Length > 0)
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = resultmess.Substring(0,resultmess.Length-2),
};
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.success,
};
}
public Model.Transaction.ResponseMessage Validate(Model.Transaction.RequestMessage req)
{
var rs = validateField(req);
if (rs.success == DataDictionary.responseResult.failed)
return rs;
if (DateTime.Now >= DateTime.Parse(req.timestamp).AddMinutes(5))
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "Expired!"
};
var rawsig = DateTime.Parse(req.timestamp).ToString("yyyyMMddHHmmss") + req.partnerkey + req.partnerrefno + req.totalamount + req.partnerpassword;
string sig = CommonUtils.EncodeBase64((CommonUtils.ComputeSha256Hash(rawsig)));
var partner = db.Partners.Where(c => c.partnerkey == req.partnerkey).FirstOrDefault();
string encodepass = CommonUtils.EncodeBase64(partner.partnerpassword);
if (partner == null || (partner != null && encodepass != req.partnerpassword) || sig != req.sig)
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "Access Denied!",
};
long total = 0;
foreach (UF.AssessmentProject.Model.Transaction.itemdetail item in req.items)
{
if( item.name.Length < 0)
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "item name cannot be null!",
};
if ( item.partneritemref.Length < 0)
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "partneritemref cannot be null!",
};
if( item.unitprice < 0 )
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "unitprice only allow positive value!",
};
if ( item.qty >0 && item.qty <=5)
total += item.qty * item.unitprice;
else
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.failed,
resultmessage = "qty only allow positive and not exceed 5",
};
}
req.totalamount = total;
return new Model.Transaction.ResponseMessage
{
success = DataDictionary.responseResult.success,
resultmessage = "Request data is valid.",
};
}
}
}
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UF.AssessmentProject.Model;
namespace UF.AssessmentProject.Providers
{
public class baseProvider
{
public dbContext db = null;
public baseProvider()
{
DbContextOptionsBuilder<dbContext> optionsBuilder = new DbContextOptionsBuilder<dbContext>();
optionsBuilder.UseInMemoryDatabase(databaseName: "UF");
db = new dbContext(optionsBuilder.Options);
SaveDataAsync();
}
public async Task<bool> SaveDataAsync()
{
await db.SaveChangesAsync();
return true;
}
}
}
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UF.AssessmentProject.logs;
using UF.AssessmentProject.Model;
namespace UF.AssessmentProject
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<dbContext>(opt => opt.UseInMemoryDatabase(databaseName: "UF"));
services.AddScoped<dbContext>();
services.AddMvc();
services.AddControllers();
/*Add Swagger Options settings START*/
services.AddSwagger();
/*Add Swagger Options settings END*/
services.AddSingleton<ILoggerManager, LoggerManager>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory logger)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
logger.AddLog4Net();
app.UseCustomSwagger();
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using Swashbuckle.AspNetCore.SwaggerUI;
namespace UF.AssessmentProject
{
/// <summary>
/// SwaggerExtension
/// all swagger related configuration put here
/// </summary>
public static class SwaggerExtension
{
/// <summary>
/// Swagger Configuration
/// </summary>
/// <param name="services"></param>
public static void AddSwagger(this IServiceCollection services)
{
services.AddSwaggerGen(x =>
{
x.SwaggerDoc("v1", new OpenApiInfo
{
Version = "v0.0.1",
Title = "SwaggerBase Api",
Description = "A simple example ASP.NET Core Web API. For Reference please click [getting-started-with-swashbuckle](https://docs.microsoft.com/en-us/aspnet/core/tutorials/getting-started-with-swashbuckle?view=aspnetcore-3.1&tabs=visual-studio) or [swagger.io/docs/](https://swagger.io/docs/)",
TermsOfService = new Uri("https://example.com/termsIfApplicable"),
License = new OpenApiLicense
{
Name = "License Use under UF testing",
Url = new Uri("https://example.com/license"),
}
});
// Set the comments path for the Swagger JSON and UI.
//ensure the xml created in your API project is read here. for this sample is SwaggerBase Project.
//ensure the xml created in your API Model project is read here. for this sample is UF.SwaggerBase.Model.API
var xmlFileName = $"{Assembly.GetExecutingAssembly().GetName().Name}*.xml";
var xmlFiles = Directory.GetFiles(AppContext.BaseDirectory, xmlFileName);
foreach (var xmlFile in xmlFiles)
{
x.IncludeXmlComments(xmlFile);
}
x.UseAllOfToExtendReferenceSchemas();
x.UseInlineDefinitionsForEnums();
#region EnumDesc
x.SchemaFilter<EnumSchemaFilter>();
#endregion
x.EnableAnnotations();
});
}
/// <summary>
/// Swagger UI Configuration
/// 1. Add Swagger Options settings here
/// 2. set Configuration Service
/// </summary>
/// <param name="app"></param>
public static void UseCustomSwagger(this IApplicationBuilder app)
{
// Enable middleware to serve generated Swagger as a JSON endpoint.
app.UseSwagger(option => { option.RouteTemplate = "swagger/{documentName}/swagger.json"; });
//// Enable middleware to serve generated Swagger as a JSON endpoint.
//app.UseSwagger();
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
// specifying the Swagger JSON endpoint.
app.UseSwaggerUI(option =>
{
option.DefaultModelsExpandDepth(0);
option.SwaggerEndpoint("/swagger/v1/swagger.json", "My API");
option.DisplayOperationId();
option.DisplayRequestDuration();
option.DefaultModelExpandDepth(5);
//option.DefaultModelRendering(ModelRendering.Model);
option.DocExpansion(DocExpansion.None);
//option.EnableDeepLinking();
//option.EnableFilter();
//option.MaxDisplayedTags(5);
option.ShowExtensions();
option.ShowCommonExtensions();
//option.EnableValidator();
//option.SupportedSubmitMethods(SubmitMethod.Get, SubmitMethod.Head);
//option.HeadContent = "<link rel='stylesheet' type='text/css' href='ui\\custom.css'>"; //to modify the ui
});
}
/// <summary>
/// Customize enum Display
/// </summary>
public class EnumSchemaFilter : ISchemaFilter
{
public void Apply(OpenApiSchema schema, SchemaFilterContext context)
{
if (context.Type.IsEnum)
{
var enumValues = schema.Enum.ToArray();
var i = 0;
schema.Enum.Clear();
foreach (var n in Enum.GetNames(context.Type).ToList())
{
schema.Enum.Add(new OpenApiString(n + $" = {((OpenApiPrimitive<int>)enumValues[i]).Value}"));
i++;
}
}
}
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="log4net" Version="2.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.1" NoWarn="NU1605" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.1" NoWarn="NU1605" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="6.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.6.3" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/Api</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>
</Project>
\ No newline at end of file
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
This diff is collapsed.
2022-06-15 11:18:06,051 INFO Microsoft.Hosting.Lifetime.MoveNext [0] - MESSAGE: Now listening on: https://localhost:5001
2022-06-15 11:18:06,397 INFO Microsoft.Hosting.Lifetime.MoveNext [0] - MESSAGE: Now listening on: http://localhost:5000
2022-06-15 11:18:06,400 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Application started. Press Ctrl+C to shut down.
2022-06-15 11:18:06,403 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Hosting environment: Development
2022-06-15 11:18:06,410 INFO Microsoft.Hosting.Lifetime.OnApplicationStarted [0] - MESSAGE: Content root path: G:\meu\UF\UF.AssessmentProject
2022-06-15 11:18:23,954 DEBUG UF.AssessmentProject.Logs.Logger.Debug [27] - MESSAGE: Start : UF.AssessmentProject.Model.Transaction.RequestMessage
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<file value="Logs\" />
<datePattern value="yyyy-MM-dd.'txt'"/>
<staticLogFileName value="false"/>
<appendToFile value="true"/>
<rollingStyle value="Date"/>
<maxSizeRollBackups value="100"/>
<maximumFileSize value="15MB"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern
value="%date [%thread] %-5level %message %newline %newline"/>
</layout>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace UF.AssessmentProject.logs
{
public interface ILoggerManager
{
void LogInformation(string message);
void LogInformation(string message, Exception ex);
void LogAdvertencia(string message);
void LogAdvertencia(string message, Exception ex);
void LogError(string message);
void LogError(string message, Exception ex);
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Xml;
using log4net;
using log4net.Config;
using Newtonsoft.Json;
namespace UF.AssessmentProject.logs
{
public class LoggerManager : ILoggerManager
{
private readonly ILog _logger = LogManager.GetLogger(typeof(LoggerManager));
public LoggerManager()
{
try
{
XmlDocument log4netConfig = new XmlDocument();
using (var fs = File.OpenRead("log4net.config"))
{
log4netConfig.Load(fs);
var repo = LogManager.CreateRepository(
Assembly.GetEntryAssembly(),
typeof(log4net.Repository.Hierarchy.Hierarchy));
string ruta = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
GlobalContext.Properties["FilePath"] = ruta.Substring(6, ruta.Length - 6);
XmlConfigurator.Configure(repo, log4netConfig["log4net"]);
}
}
catch (Exception ex)
{
_logger.Error("Error", ex);
}
}
public void LogAdvertencia(string message)
{
_logger.Warn(message);
}
public void LogAdvertencia(string message, Exception ex)
{
_logger.Warn(message, ex);
}
public void LogError(string message)
{
_logger.Error(message);
}
public void LogError(string message, Exception ex)
{
_logger.Error(message, ex);
}
public void LogInformation(string message)
{
_logger.Info(message);
}
public void LogInformation(string message, Exception ex)
{
_logger.Info(message,ex);
}
}
}
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v5.0", FrameworkDisplayName = "")]
File added
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.GeneratedMSBuildEditorConfig.editorconfig
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.AssemblyInfoInputs.cache
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.AssemblyInfo.cs
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.csproj.CoreCompileInputs.cache
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.MvcApplicationPartsAssemblyInfo.cs
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.MvcApplicationPartsAssemblyInfo.cache
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\appsettings.Development.json
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\appsettings.json
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.exe
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.deps.json
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.runtimeconfig.json
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.runtimeconfig.dev.json
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\ref\UF.AssessmentProject.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\UF.AssessmentProject.pdb
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.AspNetCore.Authentication.JwtBearer.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.AspNetCore.Authentication.OpenIdConnect.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.IdentityModel.JsonWebTokens.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.IdentityModel.Logging.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.IdentityModel.Protocols.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.IdentityModel.Tokens.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Microsoft.OpenApi.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Newtonsoft.Json.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Swashbuckle.AspNetCore.Annotations.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Swashbuckle.AspNetCore.Swagger.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Swashbuckle.AspNetCore.SwaggerGen.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\Swashbuckle.AspNetCore.SwaggerUI.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\bin\Debug\net5.0\System.IdentityModel.Tokens.Jwt.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\staticwebassets\UF.AssessmentProject.StaticWebAssets.Manifest.cache
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\staticwebassets\UF.AssessmentProject.StaticWebAssets.xml
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\scopedcss\bundle\UF.AssessmentProject.styles.css
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.RazorTargetAssemblyInfo.cache
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.csproj.CopyComplete
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\ref\UF.AssessmentProject.dll
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.pdb
C:\Users\UF-TAMMY\Desktop\Others\Test project\AssessmentProject\UF.AssessmentProject\obj\Debug\net5.0\UF.AssessmentProject.genruntimeconfig.cache
File added
{
"format": 1,
"restore": {
"G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj": {}
},
"projects": {
"G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj",
"projectName": "UF.AssessmentProject",
"projectPath": "G:\\meu\\UF\\UF.AssessmentProject\\UF.AssessmentProject.csproj",
"packagesPath": "C:\\Users\\Admin\\.nuget\\packages\\",
"outputPath": "G:\\meu\\UF\\UF.AssessmentProject\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net5.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net5.0": {
"targetAlias": "net5.0",
"dependencies": {
"Microsoft.AspNetCore.Authentication.JwtBearer": {
"target": "Package",
"version": "[5.0.1, )",
"noWarn": [
"NU1605"
]
},
"Microsoft.AspNetCore.Authentication.OpenIdConnect": {
"target": "Package",
"version": "[5.0.1, )",
"noWarn": [
"NU1605"
]
},
"Microsoft.EntityFrameworkCore.InMemory": {
"target": "Package",
"version": "[5.0.0, )"
},
"Microsoft.Extensions.Logging.Log4Net.AspNetCore": {
"target": "Package",
"version": "[6.1.0, )"
},
"Newtonsoft.Json": {
"target": "Package",
"version": "[13.0.1, )"
},
"Swashbuckle.AspNetCore": {
"target": "Package",
"version": "[5.6.3, )"
},
"Swashbuckle.AspNetCore.Annotations": {
"target": "Package",
"version": "[5.6.3, )"
},
"log4net": {
"target": "Package",
"version": "[2.0.14, )"
}
},
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.AspNetCore.App": {
"privateAssets": "none"
},
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\5.0.406\\RuntimeIdentifierGraph.json"
}
}
}
}
}
\ No newline at end of file
<?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\Admin\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.11.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Admin\.nuget\packages\" />
</ItemGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.props" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.props')" />
<Import Project="$(NuGetPackageRoot)swashbuckle.aspnetcore\5.6.3\build\Swashbuckle.AspNetCore.props" Condition="Exists('$(NuGetPackageRoot)swashbuckle.aspnetcore\5.6.3\build\Swashbuckle.AspNetCore.props')" />
</ImportGroup>
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<PkgMicrosoft_Extensions_ApiDescription_Server Condition=" '$(PkgMicrosoft_Extensions_ApiDescription_Server)' == '' ">C:\Users\Admin\.nuget\packages\microsoft.extensions.apidescription.server\3.0.0</PkgMicrosoft_Extensions_ApiDescription_Server>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.extensions.apidescription.server\3.0.0\build\Microsoft.Extensions.ApiDescription.Server.targets')" />
</ImportGroup>
</Project>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment