Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General cleanup #21

Merged
merged 2 commits into from
Dec 18, 2023
Merged
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
148 changes: 126 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
Expand All @@ -10,49 +13,73 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Mono auto generated files
mono_crash.*

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Ll]og/
[Ll]ogs/

# Visual Studio 2015 cache/options directory
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
Expand All @@ -62,6 +89,7 @@ artifacts/
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
Expand Down Expand Up @@ -90,6 +118,9 @@ ipch/
*.vspx
*.sap

# Visual Studio Trace Files
*.e2e

# TFS 2012 Local Workspace
$tf/

Expand All @@ -101,15 +132,25 @@ _ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
*.coveragexml

# NCrunch
_NCrunch_*
.*crunch*.local.xml
Expand Down Expand Up @@ -141,9 +182,9 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.pubxml
*.publishproj

# Microsoft Azure Web App publish settings. Comment the next line if you want to
Expand All @@ -153,13 +194,15 @@ PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

Expand All @@ -176,12 +219,15 @@ AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
!?*.[Cc]ache/

# Others
ClientBin/
Expand All @@ -192,9 +238,12 @@ ClientBin/
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
Expand All @@ -209,15 +258,22 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak

# SQL Server files
*.mdf
*.ldf
*.ndf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl

# Microsoft Fakes
FakesAssemblies/
Expand All @@ -227,13 +283,17 @@ FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand All @@ -249,14 +309,58 @@ paket-files/
# FAKE - F# Make
.fake/

# JetBrains Rider
.idea/
*.sln.iml

# CodeRush
.cr/
# CodeRush personal settings
.cr/personal

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
sample/DemoApp/Properties/PublishProfiles/browser-detection - Web Deploy.pubxml

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

# Tabs Studio
*.tss

# Telerik's JustMock configuration file
*.jmconfig

# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs

# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
*.binlog

# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
.mfractor/

# Local History for Visual Studio
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb

# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd

# Rider
.idea/
14 changes: 7 additions & 7 deletions BrowserDetector.sln
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{5AB86EFC-4
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserDetector.Benchmarks", "perf\BrowserDetector.Benchmarks\BrowserDetector.Benchmarks.csproj", "{74E28CEE-CBE2-49DB-811A-B63E8FDD744E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoApp.NET5", "sample\DemoApp.NET5\DemoApp.NET5.csproj", "{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserDetector.Net", "src\BrowserDetector.NetCore\BrowserDetector.Net.csproj", "{2E0D3C7A-98AA-475A-816B-3B51EA377C6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserDetector.WebApi", "sample\BrowserDetector.WebApi\BrowserDetector.WebApi.csproj", "{6369627B-5878-4CFE-A996-859D8663603C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -33,23 +33,23 @@ Global
{74E28CEE-CBE2-49DB-811A-B63E8FDD744E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74E28CEE-CBE2-49DB-811A-B63E8FDD744E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74E28CEE-CBE2-49DB-811A-B63E8FDD744E}.Release|Any CPU.Build.0 = Release|Any CPU
{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39}.Release|Any CPU.Build.0 = Release|Any CPU
{2E0D3C7A-98AA-475A-816B-3B51EA377C6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E0D3C7A-98AA-475A-816B-3B51EA377C6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E0D3C7A-98AA-475A-816B-3B51EA377C6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E0D3C7A-98AA-475A-816B-3B51EA377C6A}.Release|Any CPU.Build.0 = Release|Any CPU
{6369627B-5878-4CFE-A996-859D8663603C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6369627B-5878-4CFE-A996-859D8663603C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6369627B-5878-4CFE-A996-859D8663603C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6369627B-5878-4CFE-A996-859D8663603C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{AC18FC9B-5E79-4FDA-9B35-9F2E716C2BD9} = {12F52172-93E2-490D-B544-6BC9BFCBDE4F}
{74E28CEE-CBE2-49DB-811A-B63E8FDD744E} = {5AB86EFC-4E36-4570-BB16-C09AC8C71BAC}
{FC9EDDF8-1A96-4814-87E4-4EEAF2BCFD39} = {9E1E33C8-9F0A-42A5-909F-54079AB3AEF3}
{2E0D3C7A-98AA-475A-816B-3B51EA377C6A} = {B909FEDF-3397-4308-B8E3-E538D84AC14D}
{6369627B-5878-4CFE-A996-859D8663603C} = {9E1E33C8-9F0A-42A5-909F-54079AB3AEF3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05CFD6CC-3235-4365-8458-99DED6DBDE2D}
Expand Down
3 changes: 2 additions & 1 deletion perf/BrowserDetector.Benchmarks/DetectorBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace BrowserDetector.Benchmarks

namespace BrowserDetector.Benchmarks
{
using System;
using BenchmarkDotNet.Attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<ItemGroup>
Expand Down
30 changes: 30 additions & 0 deletions sample/BrowserDetector.WebApi/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Mvc;
using Shyjus.BrowserDetection;

namespace BrowserDetector.WebApi.Controllers
{
[ApiController]
public class HomeController : ControllerBase
{
private readonly ILogger<HomeController> _logger;
private readonly IBrowserDetector _browserDetector;
public HomeController(IBrowserDetector browserDetector, ILogger<HomeController> logger)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_browserDetector = browserDetector ?? throw new ArgumentNullException(nameof(browserDetector));
}

[HttpGet]
[Route("")]
public string Get()
{
this._logger.LogInformation("Inside GET action method");

var browser = _browserDetector.Browser;

_logger.LogInformation($"Browser:{browser?.Name},OS: {browser?.OS}");

return $".NET APP. Browser:{browser?.Name}, Version: {browser?.Version},Device type: {browser?.DeviceType}, OS: {browser?.OS}";
}
}
}
Loading