// From File var doc = new HtmlDocument(); doc.Load(filePath); // From String var doc = new HtmlDocument(); doc.LoadHtml(html); // From Web var url = “http://html-agility-pack.net/”; var web = new HtmlWeb(); var doc = web.Load(url); Source: html-agility-pack.net/
Category: programming
Building Secure ASP.NET MVC Web Applications
Introduction Building secure distributed Web applications is challenging. There’s nothing more exciting than creating a fancy web application. What isn’t as exciting, however, is the security risk involved. When it comes to web application development in today’s increasingly digitized, mobilized, Internet-of-Things world, security measures can no longer be the afterthoughts they once were. With distributed applications, you have a lot […]
Writing Testable & Clean Code
Many developers have a hate relationship with testing. However, I believe the main cause of that is code that is highly-coupled and difficult to test. This post states some principles and guidelines that can help you write easily-testable code, which is not only easier to test but also more flexible and maintainable, due to its better modularity. Here […]
C# Performance Tips
Check List has items List.Count() vs List.Any() Stopwatch watch = new Stopwatch(); List < string > strs = new List < string > () { “Akshay”, “Patel”, “Panth”, “Patel” }; watch.Start(); if (strs.Count() > 0) {} Console.WriteLine(“List.Count()-{0}”, watch.Elapsed); ——– watch.Restart(); if (strs.Any()) {} Console.WriteLine(“List.Any() – {0}”, watch.Elapsed); Loop on items in a list Array.Length vs var i […]
Entity Signal – Real Time Entity Framework (EF) and ASP.NET core
What is Entity Signal? Entity Signal allows you to connect to Entity Framework through SignalR and get updates on subscribed data in real time. This lowers the number of refreshes done by the user and ultimately allows you to do more with fewer servers. It is also requires minimal changes, so you can make realtime apps about as […]
Automate your code quality with Codacy
Codacy automates code reviews and monitors code quality over time. Static analysis, code coverage and metrics for Ruby, JavaScript, PHP, Scala, Java, Python, CoffeeScript and CSS. Source: www.codacy.com/
NCrunch is an automated concurrent testing tool for Visual Studio.
NCrunch is the ultimate live testing tool for Microsoft Visual Studio and .NET. It runs your unit and integration tests so you don’t have to, providing inline code coverage and performance metrics while you type. Source: www.ncrunch.net/