PnP Core Component - Get Content Type from the Web in SharePoint 2016

Please refer to the Introduction to PnP Core Component and OfficeDevPnP.Core for more details. I have created a console application and added SharePointPnPCoreOnline NuGet package for the SharePoint 2016 version.
 
Code Snippet
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Net;  
  5. using System.Text;  
  6. using System.Threading.Tasks;  
  7. using Microsoft.SharePoint.Client;  
  8. using OfficeDevPnP.Core;  
  9.   
  10. namespace SP2016PnPCoreComponentDemo  
  11. {  
  12.     class Program  
  13.     {  
  14.         static void Main(string[] args)  
  15.         {  
  16.             // Input Parameters  
  17.             string siteUrl = "http://c7395723754:35298/sites/VijaiDemo";  
  18.             string userName = "administrator";  
  19.             string password = "xxxxxxx";  
  20.             string domain = "AD2012";  
  21.             string listTitle = "PnP Custom List";  
  22.             string contentTypeId = "0x0100FC6F80F7923849FBBF73F0974A2DEB9E";  
  23.             string contentTypeName = "PnP Content Type";  
  24.   
  25.             OfficeDevPnP.Core.AuthenticationManager authMgr = new OfficeDevPnP.Core.AuthenticationManager();  
  26.   
  27.             try  
  28.             {  
  29.                 // Get the client context  
  30.                 using (var ctx = authMgr.GetNetworkCredentialAuthenticatedContext(siteUrl, userName, password, domain))  
  31.                 {  
  32.                     // Get Content Type By Name using CSOM Extension Method                       
  33.                     ContentType ctByName = ctx.Web.GetContentTypeByName(contentTypeName, true);  
  34.                     Console.WriteLine(ctByName.Name);  
  35.   
  36.                     // Get Content Type By ID using CSOM Extension Method                       
  37.                     ContentType ctById = ctx.Web.GetContentTypeById(contentTypeId, true);  
  38.                     Console.WriteLine(ctById.Name);  
  39.                 }  
  40.             }  
  41.   
  42.             catch (Exception ex)  
  43.             {  
  44.                 Console.WriteLine("Error Message: " + ex.Message);  
  45.             }  
  46.         }  
  47.     }  
  48. }