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

Microsoft Entra ID Application Secret Expiration Notification

Leave a Comment

Microsoft Entra ID is a cloud-based identity and access management service. It offers features like single sign-on (SSO), multifactor authentication, and automated user provisioning to enhance organizational security. 

 

In my last blog, I used Microsoft Graph API to get a Microsoft Entra ID application. Now, we are trying to extend the functionality to get the application expiry date so that we can send the notification to the application owner before it expires. 

Send alert on Microsoft Entra ID application secret expiry

DateTime currentDate = DateTime.Now;
TimeSpan duration = new TimeSpan(7, 0, 0, 0); // 7 days
DateTime resultDate = currentDate.Add(duration);
var result = await _graphServiceClient.Applications.Request().GetAsync();
var appList=new List<Models.Application>();
foreach(var app in result.CurrentPage)
{
      var isToBeExpired= app.PasswordCredentials.Where(e => e.EndDateTime <= resultDate).Count()>0?true:false;
        appList.Add(new Models.Application
        {
            Id = app.Id,
            ApplicationId = app.AppId,
            ApplicationName = app.DisplayName,
            SecretToBeExpired=isToBeExpired,
            Owner = app.Owners.FirstOrDefault().ToString()
        });
    if (isToBeExpired)
    {
        //send email to owner
    }
}

The above function will get the client's secret end date time. It checks for each application's client secret to be expired within 7 days anpreparesre the list; we can add one more function to send an email as a notification to the application owner.

Read More

ASP.NET Tutorial : C# Array Resizing with Examples

Leave a Comment

Using the Array.Resize<T> function in C#, you can resize an array. Using this method, you can set a new size for a one-dimensional array's element count. Let's examine its operation and look at a few instances.

The Array.Resize<T> Technique

The definition of the Array.Resize<T> method is as follows:

public static void Resize<T>(ref T[] array, int newSize);
  • T: The type of the elements in the array.
  • array: The one-dimensional, zero-based array to resize, or null to create a new array with the specified size.
  • newSize: The size of the new array.
Examples

Let’s look at some examples to understand how resizing affects an array.

1. Resizing to a Larger Size

Suppose we have the following string array:

string[] myArr = { "The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog" };

We can resize this array to a larger size (five elements larger):

Array.Resize(ref myArr, myArr.Length + 5);

After resizing, the array contains the following values:

2. Resizing to a Smaller Size

Now let’s resize the array to a smaller size (four elements):

Array.Resize(ref myArr, 4);

After resizing, the array contains the following values:

"The", "quick", "brown", "fox"
Remarks
  • The Array.Resize<T> method allocates a new array with the specified size, copies elements from the old array to the new one, and then replaces the old array with the new one.
  • If array is null, this method creates a new array with the specified size.
  • If newSize is greater than the length of the old array, a new array is allocated, and all the elements are copied from the old array to the new one.
  • If newSize is less than the length of the old array, a new array is allocated, and elements are copied from the old array to the new one until the new one is filled; the rest of the elements in the old array are ignored1.

Remember that Array.Resize<T> provides a convenient way to adjust the size of an array dynamically during program execution

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

Best & Cheap PrestaShop 8.1.5 Hosting in Europe

Leave a Comment
HostForLIFEASP.NET are recommended as the best PrestaShop 8.1.5 hosting providers for small business owners to start a fast, reliable, secure and budget e-commerce site in Europe. HostForLIFEASP.NET offering indispensable features, 99% uptime and blazing-fast server response time at affordable prices. In fact, PrestaShop is free and open source, providing everything needed to start and manage a successful online store.
 

Best & Cheap PrestaShop 8.1.5 Hosting in Europe

PrestaShop is an open source eCommerce solution. It comes with a variety of tools necessary for building a successful online shop. To create an online store with PrestaShop you need reliable web hosting services. With hundreds of choices from every industry, the perfect store template is waiting for you. It is written in the PHP programming language with support for the MySQL database management system.

100% PrestaShop Compatibility

In order to ensure the proper installation and working of PrestaShop, you firstly need to ensure the 100% compatibility with it. After checking the documentation of its official site, in the following, we have concluded the minimum technical requirements that your selected web host needs to meet.
  • MySQL with the minimum version of 5.0.
  • PHP with the minimum version of 5.2 and the minimum PHP memory limit of 64 MB.
  • suPHP that acts as the handler of PHP language for the increased overall security.
  • Apach with the minimum version of 1.3.
  • Powerful script installer that achieves the automatic installation of PrestaShop.

HostForLIFEASP.NET is the Best PrestaShop 8.1.5 Hosting in Europe?

One of the most important things when choosing a good PrestaShop hosting in Europe is the feature and reliability. HostForLIFE is the leading provider of Windows hosting and affordable PrestaShop 8.1.5, their servers are optimized for PHP web applications such as PrestaShop 8.1.5 The performance and the uptime of the hosting service are excellent and the features of the web hosting plan are even greater than what many hosting providers ask you to pay for. Led by a team with expert who are familiar on PrestaShop technologies, HostForLIFEASP.NET offers an array of both basic and advanced PrestaShop features in the package at the same time, such as:
  • Windows 2022 as web server, ASP.NET Core 8.0.1
  • Dedicated Application Pools
  • Support the latest PHP
  • The latest ASP.NET MVC, MySQL 5.7 Databases, and SQL Server 2016 Databases
  • URL Rewrite Module, Full Trust App support, and 30+ ASP components
  • Ease-to-use Plesk Panel helps simplify setup and management
At HostForLIFEASP.NET, customers can also experience fast PrestaShop 8.1.5 Hosting in Europe. The company invested a lot of money to ensure the best and fastest performance of the datacenters, servers, network and other facilities. Its datacenters are equipped with the top equipments like cooling system, fire detection, high speed Internet connection, and so on. That is why HostForLIFEASP.NET guarantees 99.9% uptime for PrestaShop 8.1.5. And the engineers do regular maintenance and monitoring works to assure its PrestaShop 8.1.5 Hosting in Europe are security and always up.

HostForLIFEASP.NET offers four Windows and ASP.NET with PrestaShop 8.1.5 Hosting in Europe packages as you can see on the below picture:SPECIAL OFFER PrestaShop 8.1.5 Hosting in Europe

Loading Speed

HostForLIFEASP.NET builds an excellent PrestaShop 8.1.5 Hosting in Europe environment to deliver customers a fast page loading speed in the industry, which will run up to around 1.5s. With this fast speed, visitors will not waste much time in waiting for loading pages and have a better surfing the Internet experience. And there are several important factors to maintain the fast page loading speed of HostForLIFEASP.NET PrestaShop websites all the time, like powerful datacenters, rock-solid equipment, advanced servers, world-class PrestaShop engineers and more.

http://hostforlifeasp.net/European-PrestaShop-1705-Hosting.aspx

Review on Performance

HostForLIFEASP.NET guarantees to provide 99.9% uptime and fast hosting speed for all their customers to run sites stably and rapidly. To keep this promise, this company has equipped each of their state-of-the-art data center with quality servers, armed security and many cutting-edge technologies like UPS battery backup power and dual diesel generators.


Furthermore, the data center is equipped with cooling system and fire suppression including a pre-action dry pipe system. In addition, the data center, servers and network are under 24×7 monitoring carried out by a group of technicians. Therefore, any unexpected issue can be resolved immediately, ensuring customers can run sites with maximum reliability and performance. 

Review on Technical Support 

When it comes to technical support, no matter when meeting any hosting issue, customers are able to contact the support team by starting live chat, email, helpdesk or writing a ticket. Support staffs are standing by 24 hours a day and 7 days a week, so they are able to respond quickly and offer instant and effective assistance.

Cheap PrestaShop 8.1.5 Hosting in Europe

HostForLIFE.eu provides one of the Best, Cheap PrestaShop 8.1.5 Hosting in Europe Recommendation in the industry for its affordable price, rich feature, professional customer support, and high reliability. It’s highly recommended for asp.net developers, business owners and anyone who plan to build a web site based on ASP.NET. To know more about HostForLIFE.eu or its PrestaShop 8.1.5 Hosting in Europe, please visit HostForLIFE.eu, and get a PrestaShop 8.1.5 website.

PrestaShop 8.1.5 Hosting http://hostforlifeasp.net/European-PrestaShop-1712-Hostingin Europe


Read More

ASP.NET Tutorial : Techniques for Caching in ASP.NET Core

Leave a Comment

Caching is a crucial strategy for enhancing ASP.NET Core applications' responsiveness and speed. To store and retrieve data efficiently, developers can leverage a variety of caching mechanisms provided by ASP.NET Core. Some ASP.NET Core caching techniques are listed below:

Caching in-Memory
Data is temporarily stored in the application's memory through in-memory caching.
useful for keeping somewhat static and often accessible data.

services.AddMemoryCache();

Usage in a controller

private readonly IMemoryCache _memoryCache;

public MyController(IMemoryCache memoryCache)
{
    _memoryCache = memoryCache;
}

public IActionResult MyAction()
{
    var cachedData = _memoryCache.GetOrCreate("CacheKey", entry =>
    {
        entry.SlidingExpiration = TimeSpan.FromMinutes(10);
        return GetDataFromDatabase();
    });

    return View(cachedData);
}
Distributed Caching
  • Distributed caching stores data across multiple servers to share cached data among different instances of the application.
  • Suitable for scenarios where the application is hosted on a web farm or in a cloud environment.

Example using Redis

services.AddStackExchangeRedisCache(options =>
{
    options.Configuration = "localhost:6379"; // Redis server connection string
    options.InstanceName = "SampleInstance";
});

Usage is similar to in-memory caching but with the distributed cache provider.

Response Caching
  • Response caching caches the entire HTTP response, including headers and content, at the server or client side.
  • Helps reduce the load on the server and improve client-side performance.

Example in Startup.cs

services.AddResponseCaching();

Usage in a controller or action method:

[ResponseCache(Duration = 60, Location = ResponseCacheLocation.Any)]
public IActionResult MyAction()
{
    return View();
}
Output Caching
  • Output caching caches the output of a controller action or Razor page.
  • Helps reduce the processing time of the same request repeatedly.

Example in a controller

[ResponseCache(Duration = 60, VaryByQueryKeys = new[] { "id" })]
public IActionResult MyAction(int id)
{
    return View(GetDataById(id));
}

Donut Caching
  • Donut caching is a combination of output caching and donut hole caching, where you can cache parts of a page independently.
  • Useful for caching specific sections of a page.

Example using TagHelper

<cache expires-after="@TimeSpan.FromMinutes(10)">
    <!-- Cached content here -->
</cache>
Conclusion

These caching strategies can be used individually or in combination based on the application's requirements. It's important to carefully choose the appropriate caching strategy considering factors such as data volatility, scalability, and caching granularity. Additionally, always monitor and adjust cache expiration times to ensure the cached data remains relevant.

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

How to Choose the Best Umbraco 13.0.3 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 13.0.3 site well. Because of that, we will inform you the Best Umbraco 13.0.3 Hosting in Europe provider with affordable price and high quality support. After reviewed 20+ Umbraco 13.0.3 Hosting in Europe, we had come out with the best Umbraco 13.0.3 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.

How to Choose the Best Umbraco 13.0.3 Hosting in Europe?

Our Best, Cheap Umbraco 13.0.3 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 13.0.3 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 13.0.3 Hosting in Europe. You can take advantage of the powerful Umbraco 13.0.3 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 13.0.3 Hosting in Europe Performance

HostForLIFEASP.NET Umbraco 13.0.3 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 13.0.3 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 13.0.3 Hosting in Europe

Frankly speaking, HostForLIFE is best option to host your Umbraco 13.0.3 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 13.0.3 Hosting in Europe.
 


Read More

ASP.NET Tutorial : How to Detect the Root/Jail Broken Detection .NET MAUI?

Leave a Comment

Developing a secure.NET MAUI app is critical. Rooted/jailbroken devices can bypass security protections, making them exposed. This can have an impact on both the data and operation of your app. Let's look at the hazards and how to integrate root/jailbreak detection in your.NET MAUI app.



Set up the project, install the plugin, implement it, and download the code.

Project Setup in Visual Studio
Launch Visual Studio 2022, then click Create a new project in the start box. 

In the Create a new project window, select MAUI in the All project types drop-down, select the .NET MAUI App template, and click the Next button:

  • In the configure your new project window, name your project, choose a suitable location for it, and click the Next button.
  • In the Additional information window, click the Create button:
  • Once the project is created, we can able to see the Android, iOS, Windows and other running options in the toolbar. Press the emulator or run button to build and run the app
Install Plugin
  • Open your Nuget Package Manager and search "banditoth.MAUI.JailbreakDetector" and install the latest version in your project.
Implementation
  • Open MainPage.xaml file and update the UI as per your requirement. In this sample, I have added a button to check whether the device is rooted or not.
  • You can dependency inject the jailbreak detector instance by resolving an instance of IJailbreakDetector. Store the instance in a private readonly field in your class, or use it directly.
    IJailbreakDetectorConfiguration jailbreakDetectorConfiguration = new JailbreakSettings();
    jailbreakDetectorConfiguration.MaximumPossibilityPercentage = 20;
    jailbreakDetectorConfiguration.MaximumWarningCount = 1;
    jailbreakDetectorConfiguration.CanThrowException = true;
    
    IJailbreakDetector jailbreakDetector = new JailberakDetectorService(jailbreakDetectorConfiguration);
  • Use the following code to check whether the device is rooted or not.
    if (jailbreakDetector.IsSupported())
    {
    	var isRooted = await jailbreakDetector.IsRootedOrJailbrokenAsync();
    	if (isRooted)
    	{
    		await DisplayAlert("ANDROIDMADS - .NET MAUI", "DEVICE IS ROOTED", "OK");
    	}
    	else
    	{
    		await DisplayAlert("ANDROIDMADS - .NET MAUI", "DEVICE IS NOT ROOTED", "OK");
    	}
    }

    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

    ASP.NET Tutorial : Domain-Driven Design using Record in C#

    Leave a Comment

    A software engineering project's success depends on effective domain logic modeling. Domain-Driven Design (DDD) is a paradigm for designing applications around the domain model, emphasizing the essential business concepts and their interactions. DDD relies heavily on modeling domain concepts as value objects that encapsulate small chunks of domain knowledge. C# 9.0 provides Records, a strong feature that perfectly matches with DDD concepts, particularly when modeling value objects. This article investigates how Records in C# can be used to improve DDD, with an emphasis on value objects and illustrative examples.

    Understanding the Value Objects in DDD

    DDD defines value objects as immutable objects that represent concepts or measurements. They are characterized exclusively by their characteristics and lack a distinct identity apart from their values. Value things include email addresses, money, and temperature. Value objects are essential to DDD because they assist describe domain logic in a succinct and understandable way.

    Record in C#

    Records, introduced in C# 9.0, are a new type that allows you to easily design immutable data structures. They are defined with the record keyword and provide built-in support for immutability, equality comparison, and other standard operations.

    Let's look at an example:
    public record Point(int X, int Y);

    In this snippet, Point is declared as a record with two properties: X and Y. Records automatically generate constructors, equality members, and other useful methods based on their properties.

    Utilizing Records as Value Objects in DDD

    Records offer several advantages when used to model value objects in DDD:

    1. Immutability: Records are immutable by default, meaning once created, their state cannot be modified. This aligns perfectly with the nature of value objects, which should remain unchanged once instantiated.
    2. Conciseness: Records eliminate boilerplate code typically associated with immutable classes, resulting in cleaner and more concise code. This enhances readability and reduces the chance of errors.
    3. Built-in Equality Semantics: Records provide value-based equality semantics out of the box. Two record instances are considered equal if all their properties are equal. This simplifies equality comparisons, which are crucial in DDD.
    4. Pattern Matching: C# pattern matching can be seamlessly integrated with records, enabling powerful and expressive domain logic. Pattern matching facilitates pattern-based algorithms and decision-making, further enhancing the flexibility of DDD implementations.

    Example. Using Records for Value Objects

    Let's consider modeling a Temperature value object using a record in C#.

    public record Temperature(double Value, TemperatureUnit Unit);
    
    public enum TemperatureUnit { Celsius, Fahrenheit }
    
    public class WeatherForecast
    {
        public Temperature MaxTemperature { get; init; }
        public Temperature MinTemperature { get; init; }
    }

    In this example, Temperature is defined as a record with two properties: Value and Unit. The TemperatureUnit enum represents the unit of measurement. The WeatherForecast class utilizes Temperature value objects to represent maximum and minimum temperatures.

    Conclusion

    Records in C# provide a powerful mechanism for defining immutable reference types, making them an excellent choice for modeling value objects in DDD. By leveraging records, developers can create clear, expressive, and maintainable domain models that accurately reflect the underlying business concepts.

    Incorporating records into DDD practices enhances code readability, simplifies domain modeling, and promotes adherence to core DDD principles such as immutability and value-based equality. As C# evolves, records stand out as a valuable tool for building robust and domain-driven applications that effectively capture and represent complex domain logic.

    Read More
    Previous PostOlder Posts Home