Wangkanai.Detection 2.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Wangkanai.Detection --version 2.0.0                
NuGet\Install-Package Wangkanai.Detection -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wangkanai.Detection" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Wangkanai.Detection --version 2.0.0                
#r "nuget: Wangkanai.Detection, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Wangkanai.Detection as a Cake Addin
#addin nuget:?package=Wangkanai.Detection&version=2.0.0

// Install Wangkanai.Detection as a Cake Tool
#tool nuget:?package=Wangkanai.Detection&version=2.0.0                

ASP.NET Core Detection

GitHub Build status GitHub Open Collective Patreon

  • Wangkanai.Detection NuGet Badge NuGet Badge
  • Wangkanai.Responsive NuGet Badge NuGet Badge

Build history

ASP.NET Core client web browser detection extension to resolve devices, platforms, engine of the client.

ASP.NET Core Responsive middleware for routing base upon request client device detection to specific view

ASP.NET Core Responsive

Installation

Installation of detection library is now done with a single package reference point.

PM> install-package Wangkanai.Detection

Installation of Responsive library will bring in all dependency packages (This will include `Wangkanai.Detection.Device).

PM> install-package Wangkanai.Responsive

Configuration

This library host the component to resolve the access client device type.

Implement of the library into your web application is done by configuring the Startup.cs by adding the detection service in the ConfigureServices method.

public void ConfigureServices(IServiceCollection services)
{
	// Add detection services container and device resolver service.
    services.AddDetection();

    // Add framework services.
    services.AddMvc();
}
  • AddDetection() Adds the detection services to the services container.

If you would like to add Responsive is configured in the ConfigureServices method also:

public void ConfigureServices(IServiceCollection services)
{
    // Add responsive services.
    services.AddResponsive();

    // Add framework services.
    services.AddMvc();  
}

Or you can customize the responsive

public void ConfigureServices(IServiceCollection services)
{
    // Add responsive services.
    services.AddResponsive(options =>
    {
        options.View.DefaultTablet = DeviceType.Desktop;
        options.View.DefaultMobile = DeviceType.Desktop;
        options.View.DefaultDesktop = DeviceType.Desktop;
    });

    // Add framework services.
    services.AddMvc();  
}
  • AddResponsive() Adds the Responsive services to the services container.

    • Suffix Ex *views/[controller]/[action]/index.mobile.cshtml*
    • SubFoler Ex *views/[controller]/[action]/mobile/index.cshtml*

The current device on a request is set in the Responsive middleware. The Responsive middleware is enabled in the Configure method of Startup.cs file.

public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
    app.UseResponsive();

    app.UseMvc(routes =>
    {
        routes.MapRoute(
            name: "default",
            template: "{controller=Home}/{action=Index}/{id?}");
    });
}

Global Resolver

This library host the component to resolve all the access client related resolver that could resolve.

Example of calling the detection service in the Controller using dependency injection.

public class HomeController : Controller
{
    private readonly IDetection _detection;

    public HomeController(IDetection detection)
    {
        _detection = detection;
    }

    public IActionResult Index()
    {
        return View(_detection);
    }
}
  • IDetection is main service for you to access detection service.

When the Detection is pass to the view you can render results like the following example.

@model Wangkanai.Detection.Detection

<h3>UserAgent</h3>
<code>@Model.UserAgent</code>

<h3>Results</h3>

<table>
    <thead>
        <tr>
            <th>Resolver</th>
            <th>Type</th>
            <th>Version</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <th>Device</th>
            <td>@Model.Device?.Type.ToString()</td>
            <td></td>
        </tr>
        <tr>
            <th>Browser</th>
            <td>@Model.Browser?.Type.ToString()</td>
            <td>@Model.Browser?.Version</td>
        </tr>
        <tr>
            <th>Platform</th>
            <td>@Model.Platform?.Type.ToString()</td>
            <td>@Model.Platform?.Version</td>
        </tr>
        <tr>
            <th>Engine</th>
            <td>@Model.Engine?.Type.ToString()</td>
            <td>@Model.Engine?.Version</td>
        </tr>
        <tr>
            <th>Crawler</th>
            <td>@Model.Crawler?.Type.ToString()</td>
            <td>@Model.Crawler?.Version</td>
        </tr>
    </tbody>
</table>
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (13)

Showing the top 5 NuGet packages that depend on Wangkanai.Detection:

Package Downloads
WebVella.Erp.Web

The web components library for the open-source and free platform WebVella ERP. It allows a quick and painless creation of business web applications.

Wangkanai.Responsive

ASP.NET Core Responsive middleware for routing base upon request client device detection to specific view. Also in the added feature of user preference made this library even more comprehensive must for developers whom to target multiple devices with view rendered and optimized directly from the server side.

Wangkanai.Analytics

Embrace the power of data with Analytics, a .NET Core library for comprehensive website tracking. Delve into insightful statistics, understand your audience better, and make data-driven decisions with ease. From session duration to bounce rate, Analytics transforms raw data into meaningful insights. Join our community, shine a light on your website's performance, and let's unlock the full potential of website analytics with Analytics.

ZC.Middleware.DefaultAPI

Package Description

Wangkanai.Webmaster

Revolutionize your SEO with Wangkanai Webmaster. This ASP.NET Core tool boosts your site's traffic and visibility. Ideal for developers aiming to elevate their site's SEO. A must-have for enhanced web traffic, visibility, and efficiency

GitHub repositories (7)

Showing the top 5 popular GitHub repositories that depend on Wangkanai.Detection:

Repository Stars
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 10 Preview 2, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
grandnode/grandnode
Open source, headless, multi-tenant eCommerce platform built with .NET Core, MongoDB, AWS DocumentDB, Azure CosmosDB, Vue.js.
WebVella/WebVella-ERP
Free and open-source pluggable ERP and CRM software based on ASP.NET Core 9, RazorPages and PostgreSQL . Targets Linux or Windows as host OS.
grandnode/grandnode2
E-commerce platform built with ASP.NET Core using MongoDB for NoSQL storage
mrellipse/toucan
Boilerplate template using Vue.js, TypeScript and .NET Core 2.1, based on SOLID design principles
Version Downloads Last updated
8.14.0 243,473 5/8/2024
8.13.0 6,723 4/27/2024
8.12.0 74,309 3/9/2024
8.11.0 111,625 11/27/2023
8.10.0 2,338 11/23/2023
8.9.0 12,510 11/17/2023
8.8.0 1,975 11/15/2023
8.7.0 12,795 11/1/2023
8.6.0 1,029 10/22/2023
8.5.0 732 10/6/2023
8.4.0 902 9/28/2023
8.3.0 848 9/21/2023
8.2.0 2,278 7/20/2023
8.1.0 31,597 7/1/2023
8.0.0 2,323 6/28/2023
7.4.0 209,047 6/16/2023
7.3.2 243,344 6/7/2023
7.3.1 2,008 6/7/2023
7.3.0 51,733 5/15/2023
7.2.0 3,118 5/11/2023
7.1.1 46,820 4/13/2023
7.1.0 17,485 4/3/2023
7.0.0 98,584 1/18/2023
6.11.4 62,023 1/17/2023
6.11.3 46,856 1/10/2023
6.11.2 5,703 1/3/2023
6.11.1 2,630 12/31/2022
6.11.0 10,988 12/27/2022
6.10.0 5,311 12/23/2022
6.9.0 39,742 11/30/2022
6.8.0 12,069 11/28/2022
6.7.0 1,468 11/27/2022
6.6.0 4,180 11/26/2022
6.5.0 1,356 11/26/2022
6.4.0 2,412 11/24/2022
6.3.0 1,578 11/24/2022
6.2.0 24,184 11/14/2022
6.1.0 22,128 11/9/2022
6.0.0 3,197 11/9/2022
5.7.3 54,087 10/16/2022
5.7.2 34,922 9/27/2022
5.7.1 50,563 9/19/2022
5.7.0 11,503 9/13/2022
5.6.0 2,046 9/13/2022
5.5.300 3,626 9/9/2022
5.5.200 159,280 8/23/2022
5.5.100 3,395 8/21/2022
5.4.0 1,011 8/20/2022
5.3.0 65,677 6/23/2022
5.2.1 83,798 5/2/2022
5.2.0 190,862 3/8/2022
5.1.0 59,199 3/6/2022
5.0.0 15,087 2/9/2022
5.0.0-alpha8 781 2/9/2022
5.0.0-alpha7 760 2/8/2022
5.0.0-alpha6 493 2/8/2022
5.0.0-alpha5 837 2/4/2022
5.0.0-alpha4 4,269 12/7/2021
5.0.0-alpha3 598 12/5/2021
5.0.0-alpha2 549 12/4/2021
5.0.0-alpha1 520 12/3/2021
4.0.0 226,068 12/2/2021
4.0.0-beta4 545 12/2/2021
4.0.0-beta3 5,728 7/30/2021
4.0.0-beta2 68,067 5/11/2021
4.0.0-Beta1 913 5/5/2021
3.0.0 426,781 12/20/2020
3.0.0-beta2 798 12/20/2020
3.0.0-beta1 7,415 11/22/2020
3.0.0-alpha14 19,390 10/19/2020
3.0.0-alpha13 3,009 10/12/2020
3.0.0-alpha12 1,223 10/3/2020
3.0.0-alpha11 2,926 9/25/2020
3.0.0-alpha10 39,726 5/18/2020
3.0.0-alpha09 76,035 2/18/2020
3.0.0-alpha08 881 2/14/2020
3.0.0-alpha07 3,766 2/6/2020
3.0.0-alpha06 1,468 2/3/2020
3.0.0-alpha05 2,139 1/27/2020
3.0.0-alpha04 784 1/27/2020
3.0.0-alpha03 794 1/26/2020
3.0.0-alpha02 836 1/18/2020
3.0.0-alpha01 1,706 1/14/2020
2.0.1 258,407 9/25/2020
2.0.0 216,699 12/29/2019