Meet The Author

I'm Ethan Jackson, An 25 years old blogger Currently living in London, United Kingdom. I'm a Skilled Blogger, Part Time web Developer And Creating new things as a web Designer.

author

Join vs. Except and Intersect in SQL

Leave a Comment

There are several methods available when using SQL to mix data from several tables. The JOIN keyword as well as the EXCEPT and INTERSECT keywords are two popular approaches. Together, we will examine each of these techniques and determine their appropriate applications.


SQL JOIN

Combining rows from two or more tables based on a shared column between them is done with the JOIN keyword. By indicating the relationship between the tables, it enables us to access data from several tables. There are various JOIN kinds, each with a distinct function, including FULL JOIN, LEFT JOIN, RIGHT JOIN, and INNER JOIN.

Take into consideration, for illustration, the "Customers" and "Orders." We can utilize the following to obtain the client data and the orders that relate to them.

SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
JOIN Orders ON Customers.CustomerID = Orders.CustomerID;

This query combines the "Customers" and "Orders" tables based on the common "CustomerID" column, returning the customer name and their order ID.

EXCEPT and INTERSECT

On the other hand, the EXCEPT and INTERSECT keywords are used to compare and combine the result sets of two SELECT statements. The EXCEPT keyword returns the distinct rows from the first SELECT statement that are not present in the second SELECT statement. It is useful for finding the differences between two sets of data.

For example, let's say we have two tables: "Employees" and "Managers." To find the employees who are not managers, we can use the following SQL query.

SELECT EmployeeID
FROM Employees
EXCEPT
SELECT EmployeeID
FROM Managers;

This query returns the employee IDs that are in the "Employees" table but not in the "Managers" table.

On the other hand, the INTERSECT keyword returns the distinct rows that are common to both SELECT statements. It is useful for finding the common elements between two sets of data.

For example, consider two tables: "Students" and "ScholarshipRecipients." To find the students who are also scholarship recipients, we can use the following SQL query.

SELECT StudentID
FROM Students
INTERSECT
SELECT StudentID
FROM ScholarshipRecipients;

This query returns the student IDs that are present in both the "Students" and "ScholarshipRecipients" tables.

JOIN keyword is used to combine rows from multiple tables based on a related column, while the EXCEPT and INTERSECT keywords are used to compare and combine the result sets of two SELECT statements. Understanding the differences between these keywords and when to use them is essential for effective data retrieval and analysis in SQL.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest SQL Server 2022 Hosting. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2012 R2, SQL Server 2014, ASP.NET 4.5.2, ASP.NET MVC 6.0, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

ASP.NET Tutorial : Ocelot is a Free and Open-source API Gateway

Leave a Comment

Ocelot is a free and open-source API Gateway developed on the.NET framework. Its purpose is to assist us in creating a single starting point for our microservices-based apps. The major purpose of Ocelot is to make it easy to submit requests to appropriate services. It also offers authentication, load sharing, and service discovery capabilities.



Tahir Naushad, a Microsoft software engineer, originally released Ocelot in 2016. It has now become one of the most well-known API Gateway solutions for.NET-based microservices, and it is widely utilized in the.NET community.

Ocelot can be used if you have a microservices-based design and wish to have a single access point for all of your services. By routing and transmitting requests, Ocelot can make it easy to send them to the appropriate microservices. It also offers authentication, load sharing, and service discovery capabilities.

Ocelot is the greatest API Gateway option for the.NET platform because it is compact and simple to use. It is intended to assist developers in creating a single starting point for their microservices-based apps. Ocelot's added capabilities, such as load sharing, service discovery, and authentication, can help you send requests to the proper microservices more easily.
How to Apply

Begin by including the following package:

dotnet add package Ocelot

Add to the Program.cs:

using Ocelot.DependencyInjection;
using Ocelot.Middleware;

...

builder.Services.AddOcelot();

builder.Configuration.AddJsonFile("ocelot.json");

...

var app = builder.Build();

await app.UseOcelot();

Create a JSON config file:

{
    "Routes": [
        {
            "DownstreamPathTemplate": "/api/{everything}",
            "DownstreamScheme": "https",
            "DownstreamHostAndPorts": [
                {
                    "Host": "exampleinternalapi.com",
                    "Port": 443
                }
            ],
            "UpstreamPathTemplate": "/internal/{everything}",
            "UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete" ]
        }
    ]
}
Start Your Application
When you run your application, it will start listening for requests and routing them based on the Ocelot configuration.

This is a simple setup. Ocelot also offers more complex features like authentication, load balancing, and caching, which you may want to look into depending on your use case.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 7.0.10 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

Special for you! ASP.NET Core 7.0.12 Hosting in Europe

Leave a Comment
Based on its useful features and easy to use, many developer need powerful web hosting to support their ASP.NET Core 7.0.12 site well. Because of that, we will inform you the Best ASP.NET Core 7.0.12 Hosting in Europe provider with affordable price and high quality support. After reviewed 20+ ASP.NET Core 7.0.12 Hosting in Europe, we had come out with the best ASP.NET Core 7.0.12 Hosting in Europe, control libraries, databases, technical support, and web hosting price. 


ASP.NET Core is a free and open-source web framework, and higher performance than ASP.NET, developed by Microsoft and the community. It is a modular framework that runs on both the full .NET Framework, on Windows, and the cross-platform .NET Core. Despite being a new framework, built on a new web stack, it does have a high degree of concept compatibility with ASP.NET MVC. ASP.NET Core applications supports side by side versioning in which different applications, running on the same machine, can target different versions of ASP.NET Core. This is not possible with previous versions of ASP.NET.

Best & Cheap ASP.NET Core 7.0.12 Hosting in Europe

Our Best, Cheap ASP.NET Core 7.0.12 Hosting in Europe Recommendation goes to HostForLIFEASP.NET, a leading web hosts who is well-known for offering high quality Windows hosting from shared hosting

http://hostforlifeasp.net/European-ASPNET-Core-2-Hosting

Founded in United Kingdom, and with years’ expansion, HostForLIFEASP.NET has grown into one of top 10 ASP.NET Core 7.0.12 Hosting in Europe hosting providers for offers reliable and affordable web hosting services on Windows platforms. HostForLIFEASP.NET a worldwide provider of hosting support the latest release of Microsoft's widely-used ASP.NET Core 7.0.12 Hosting in Europe. You can take advantage of the powerful ASP.NET Core 7.0.12 Hosting in Europe technology in all Windows Shared Hosting, Windows Reseller Hosting and Windows Cloud Hosting Packages. 

SALE 35% OFF NOW!

HostForLIFEASP.NET Budget Friendly Price – The service includes 4 packages called as HostForLIFE Basic, Budget, Economy and Business with the price starting at Є2.97/mo.


  • 30 Days Money Back Guarantee – This means webmasters are allowed to get a refund if they cancel the services because of dissatisfaction within the first 30 days.
  • Satisfactory Uptime – HostForLIFEASP.NET employs state-of-the-art data centers and advanced technologies guaranteeing 99.99% uptime shown by the following chart.

HostForLIFE ASP.NET Core 7.0.12 Hosting in Europe Performance

HostForLIFEASP.NET ASP.NET Core 7.0.12 web host reliability is absolutely outstanding compared to other comprehensive web hosting companies. HostForLIFEASP.NET is managed by a sophisticated team with lots of Windows server experts. With the correct IIS, website and file system permission configuration, the security of the hosting websites is well isolated. That means, when one website is hacked by improper code, it’s rare opportunity for other websites be affected.

Technical Support

As introduced above, HostForLIFEASP.NET has an experienced team on supporting ASP.NET and ASP.NET Core 7.0.12 Hosting in Europe. All of their technical support staffs are kindly, sophisticated and knowledgeable on either Windows platform or SQL Server 2016 databases. HostForLIFEASP.NET provides 24/7 email and ticket system support mainly. Based on our testing, the average of the first response is about 30 minutes, and it could be faster in working time. HostForLIFEASP.NET guarantees to respond each support ticket in 12 hours.

HostForLIFE is Best Option for ASP.NET Core 7.0.12 Hosting in Europe

Frankly speaking, HostForLIFE is best option to host your ASP.NET Core 7.0.12 Hosting in Europe. You just need to spend €2.97/month to host your site with them and you can install the latest ASP.NET Core 7.0.12 via their Plesk control panel. We would highly recommend them as your ASP.NET Core 7.0.12 Hosting in Europe.

http://hostforlifeasp.net/European-ASPNET-Core-2-Hosting

Read More

Handling case-insensitive regex in C#

Leave a Comment

You can use the System in C#.To work with regular expressions, use the Text.RegularExpressions namespace. You may handle case insensitive regex from this blog. To deal with case-insensitive situations


Essentially, we use the regular expression below to validate and restrict gmail.com from the user's email address.string pattern = "^[a-zA-Z0-9._%+-]+@(?!gmail\.com)([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$";

The problem with the above pattern is it is case-insensitive. When the user type [email protected], it will fail. We used to convert the email address to lowercase before the pattern check, but we can handle it with the regex itself using the below options.

1. Using RegexOptions.IgnoreCase

string pattern = "^[a-zA-Z0-9._%+-]+@(?!gmail\\.com)([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$";

string input = "[email protected]";

Regex regex = new Regex(pattern,RegexOptions.IgnoreCase);

bool isValid = regex.IsMatch(input);

We can use the IgnoreCase flag when creating a Regex object.

2. Using (?i) Modifier

string pattern = @"(?i)^[a-zA-Z0-9._%+-]+@(?!gmail\\.com)([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$";
string input = "[email protected]";
Regex regex = new Regex(pattern);
bool isValid = regex.IsMatch(input);

Modifier (?i) turns on the case insensitive mode for the rest of the pattern.

We have seen a pretty handful of ways to handle the case-insensitive option with regex in C#.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 7.0.10 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More

Choosing the Best Umbraco 12.2.0 Hosting in Europe

Leave a Comment
Based on its useful features and easy to use, many developer need powerful web hosting to support their Umbraco 12.2.0 site well. Because of that, we will inform you the Best Umbraco 12.2.0 Hosting in Europe provider with affordable price and high quality support. After reviewed 20+ Umbraco 12.2.0 Hosting in Europe, we had come out with the best Umbraco 12.2.0 Hosting in Europe, control libraries, databases, technical support, and web hosting price.
 

Umbraco CMS is a fully-featured open source content management system with the flexibility to run anything from small campaign or brochure sites right through to complex applications for Fortune 500's and some of the largest media sites in the world. Umbraco is easy to learn and use, making it perfect for web designers, developers and content creators alike.

Umbraco is strongly supported by both an active and welcoming community of users around the world, and backed up by a rock-solid commercial organization providing professional support and tools. Umbraco can be used in its free, open-source format with the additional option of professional tools and support if required.

Choosing the Best Umbraco 12.2.0 Hosting in Europe

Our Best, Cheap Umbraco 12.2.0 Hosting in Europe Recommendation goes to HostForLIFEASP.NET, a leading web hosts who is well-known for offering high quality Windows hosting from shared hosting. HostForLIFEASP.NET founded in United Kingdom, and with years’ expansion, HostForLIFEASP.NET has grown into one of top 10 Umbraco 12.2.0 Hosting in Europe hosting providers for offers reliable and affordable web hosting services on Windows platforms. HostForLIFEASP.NET a worldwide provider of hosting support the latest release of Microsoft's widely-used Umbraco 12.2.0 Hosting in Europe. You can take advantage of the powerful Umbraco 12.2.0 Hosting in Europe technology in all Windows Shared Hosting, Windows Reseller Hosting and Windows Cloud Hosting Packages.



Is Price Affordable ?

HostForLIFEASP.NET Budget Friendly Price – The service includes 4 packages called as HostForLIFE Basic, Budget, Economy and Business with the price starting at Є3.49/mo and now, with 15% OFF you can get only Є3.49/month.
  • 30 Days Money Back Guarantee – This means webmasters are allowed to get a refund if they cancel the services because of dissatisfaction within the first 30 days.
  • Satisfactory Uptime – HostForLIFEASP.NET employs state-of-the-art data centers and advanced technologies guaranteeing 99.99% uptime shown by the following chart. 

HostForLIFE Umbraco 12.2.0 Hosting in Europe Performance

HostForLIFEASP.NET Umbraco 12.2.0 web host reliability is absolutely outstanding compared to other comprehensive web hosting companies. HostForLIFEASP.NET is managed by a sophisticated team with lots of Windows server experts. With the correct IIS, website and file system permission configuration, the security of the hosting websites is well isolated. That means, when one website is hacked by improper code, it’s rare opportunity for other websites be affected.

Technical Support

As introduced above, HostForLIFEASP.NET has an experienced team on supporting ASP.NET and Umbraco 12.2.0 Hosting in Europe. All of their technical support staffs are kindly, sophisticated and knowledgeable on either Windows platform or SQL Server 2014 databases. HostForLIFEASP.NET provides 24/7 email and ticket system support mainly. Based on our testing, the average of the first response is about 30 minutes, and it could be faster in working time. HostForLIFEASP.NET guarantees to respond each support ticket in 12 hours.

Conclusion – HostForLIFE is Best Option for Umbraco 12.2.0 Hosting in Europe

Frankly speaking, HostForLIFE is best option to host your Umbraco 12.2.0 Hosting in Europe. You just need to spend €2.97/month to host your site with them and you can install the latest Umbraco via their Plesk control panel. We would highly recommend them as your Umbraco 12.2.0 Hosting in Europe.
 


Read More

Selecting the Best Joomla 5.0.0 Hosting in Europe

Leave a Comment
Based on its useful features and easy to use, many developer need powerful web hosting to support their Joomla 5.0.0 site well. Because of that, we will inform you the Best Joomla 5.0.0 Hosting in Europe provider with affordable price and high quality support. After reviewed 50+ Joomla 5.0.0 Hosting in Europe, we had come out with the best Joomla 5.0.0 Hosting in Europe, control libraries, databases, technical support, and web hosting price. Joomla! is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla! the most popular Web site software available.
 

Selecting the Best Joomla 5.0.0 Hosting in Europe

Our Best, Cheap Joomla 5.0.0 Hosting in Europe Recommendation goes to HostForLIFE.eu, a leading web hosts who is well-known for offering high quality Windows hosting from shared hosting. Founded in United Kingdom, and with years’ expansion, HostForLIFE.eu has grown into one of top 10 Joomla 5.0.0 Hosting in Europe hosting providers for offers reliable and affordable web hosting services on Windows platforms. HostForLIFE.eu a worldwide provider of hosting support the latest release of Microsoft's widely-used Joomla 5.0.0 Hosting in Europe. You can take advantage of the powerful Joomla 5.0.0 Hosting in Europe technology in all Windows Shared Hosting, Windows Reseller Hosting and Windows Cloud Hosting Packages.

http://HostForLIFE.eu/

30 Days Money Back Guarantee – This means webmasters are allowed to get a refund if they cancel the services because of dissatisfaction within the first 30 days.

Satisfactory Uptime – HostForLIFE.eu employs state-of-the-art data centers and advanced technologies guaranteeing 99.99% uptime shown by the following chart.

Performance

HostForLIFE.eu Joomla 5.0.0 web host reliability is absolutely outstanding compared to other comprehensive web hosting companies. HostForLIFE.eu is managed by a sophisticated team with lots of Windows server experts. With the correct IIS, website and file system permission configuration, the security of the hosting websites is well isolated. That means, when one website is hacked by improper code, it’s rare opportunity for other websites be affected

http://HostForLIFE.eu/European-Joomla-383-Hosting

Technical Support

As introduced above, HostForLIFE.eu has an experienced team on supporting ASP.NET and Joomla 5.0.0 Hosting in Europe. All of their technical support staffs are kindly, sophisticated and knowledgeable on either Windows platform or SQL Server 2016 databases. HostForLIFE.eu provides 24/7 email and ticket system support mainly. Based on our testing, the average of the first response is about 30 minutes, and it could be faster in working time. HostForLIFE.eu guarantees to respond each support ticket in 12 hours.

HostForLIFE is Best Joomla 5.0.0 Hosting in Europe

Frankly speaking, HostForLIFE is best option to host your Joomla 5.0.0 Hosting in Europe. You just need to spend €2.97/month to host your site with them and you can install the latest Joomla via their Plesk control panel. We would highly recommend them as your Joomla 5.0.0 Hosting in Europe.
http://HostForLIFE.eu/ASPNET-Shared-European-Hosting-Plans.aspx

Read More

ASP.NET Tutorial : The Benefits of Test-Driven Development (TDD) in.NET Core

Leave a Comment

Test-Driven Development (TDD) is an effective way to writing robust, maintainable code in the realm of software development. This practice, particularly in.NET Core, encourages the creation of tests prior to the creation of actual code. Following this method ensures that developers' code matches the desired requirements and is resistant to modifications over time. In this blog, we'll go over the fundamentals of TDD utilizing XUnit and Moq in a.NET Core context, as well as demonstrate its implementation with an example.


What exactly is TDD in.NET Core?

  1. TDD follows a straightforward but effective cycle: Red, Green, Refactor.
  2. Write a failed test that explains the needed functionality in red.
  3. Green: Write the bare minimum of code needed to pass the test.
  4. Refactoring is the process of improving code without affecting its behavior, ensuring that it is clean and maintainable.

Example Scenario

Let's simulate a basic scenario: creating a simple calculator class that performs addition. Our goal is to ensure the calculator correctly adds two numbers. We'll be using XUnit for unit testing and Moq for mocking dependencies.

Step 1. Installation

To set up the project with XUnit and Moq, install the necessary packages.

Step 2. Writing the Test

Create a new test class to cover the functionality of the calculator.

using Microsoft.Extensions.Logging;
using Moq;

namespace TDDApproach.Test
{
    public class CaclulatorTests
    {
        [Fact]
        public void Add_TwoNumbers_ReturnsSum()
        {
            // Arrange
            var logger = new Mock<ILogger<Calculator>>();
            var calculator = new Calculator(logger.Object);

            // Act
            var result = calculator.Add(3, 5);

            // Assert
            Assert.Equal(8, result);
        }
    }
}
Step 3. Implementing the Calculator

Now, let's create the Calculator class that will satisfy the test.

using Microsoft.Extensions.Logging;

namespace TDDApproach
{
    public class Calculator
    {
        private readonly ILogger _logger;
        public Calculator(ILogger loggger)
        {
            _logger = loggger;

        }

        public int Add(int a, int b)
        {
            _logger.LogInformation($"Adding {a} and {b}");
            return a + b;
        }

    }
}

Step 4. Running the Test

Execute the test to see it fail, then implement the Calculator class to make the test pass. Once passing, refactor the code to enhance its quality without altering the behavior.

Conclusion
Test-Driven Development in.NET Core with XUnit and Moq enables developers to write reliable, maintainable code by developing tests before the real code. This iterative method assures that the program performs as planned while still remaining responsive to changes.

Developers can improve the overall quality of their.NET Core applications by following the Red-Green-Refactor cycle.

TDD is a methodology that encourages a deeper grasp of requirements and aids in the production of more robust, error-resistant code.

Remember that this is only a basic instance. TDD may be applied to increasingly complicated projects, greatly improving software stability and maintainability.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2022 R2, SQL Server 2022, ASP.NET Core 7.0.10 , ASP.NET MVC, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Read More
Previous PostOlder Posts Home