Build the future of communications.
Start Building for Free

.NET posts

  • By Niels Swimberghe
    How to build a URL Shortener with C# .NET and Redis Build a URL Shortener with .NET and Redis

    URLs are used to locate resources on the internet, but URLs can be long making them hard to use. Especially when you have to type the URL manually, even more so when having to do so on a mobile phone. Long URLs are also problematic when you have a limited amount of characters such as within an SMS segment or a Tweet.

    A solution to this is to use a URL shortener which will create URLs that are short and sweet. When you open the shortened URL, the URL will forward you to the long destination URL. This makes it easier to manually type the URL and also save precious characters.

    Shortened URLs also obfuscate the real URL so users don't know where they will land on the internet when they click the URL. This could be abused by malicious actors, so make sure your URL shortener is secure! If …

    Read More
  • By Rahul Rai
    Implementing Stateful Work-In-Progress Pattern with Durable Azure Functions Implement Stateful Work-In-Progress Pattern with Durable Azure Functions

    In some cases, you need to gather chunks of data from multiple sources and submit the final information package to the server for processing. The work-in-progress (WIP) pattern enables you to gather lots of data over a long period of time before reviewing it and submitting the data collected for processing.

    The key component of the WIP pattern is a persistent “work document” that you keep enriching with input over time and finally submit to the server after a review. The work document is not a single entity, and the pattern allows you to manage several work documents simultaneously. For example, you might want to create individual work documents for every customer requesting approval for credit purchases.

    A work-in-progress application should support the following operations:

    1. Create document: Create a new work document.
    2. Read document: Get a single work document.
    3. List documents: Get the list of work documents. …
    Read More
  • By Bryan Hogan
    Dockerize your SQL Server and use it in ASP.NET Core with Entity Framework Core How to containerize your SQL Server with Docker and use it in ASP.NET Core with EF Core.

    I love learning and writing blogs about .NET and related technologies. One of my favorites over the past 10 years or so has been Entity Framework (EF) and Entity Framework Core (EF Core). I have used it professionally with MS SQL Server, Postgres, and MySQL. But the thing I don’t like is installing these databases on my computer, they are large, they add services that run on startup, and consume lots of resources.

    Instead, when I want to write an application using EF and one of those databases, I download a docker image for the database, start up the container, and connect to that instance from my .NET application. When I’m done for the day, I shut down the container, and when I’m done with the application, I delete the container, and image, and my system is clean of the database.

    The other great thing about using a database in …

    Read More
  • By Néstor Campos
    How to test web applications with Playwright and C# .NET Test web apps with Playwright and C# .NET

    Testing your applications is a fundamental part of any project, whether it is to find errors during development, or to verify the expected behavior of your application in each action that a user may or may not execute.

    In this post, you are going to use a simple form and test it using Playwright and C# to verify its operation with both correct and incorrect information, simulating the actions of users.

    Prerequisites

    You will need the following for your development environment:

    Test types

    You can create different types of tests to verify your software:

    • Unit tests test individual methods and functions of the classes, components, or modules your software uses.
    • Integration tests verify that …
    Read More
  • By Similoluwa Adegoke
    Respond to Twilio Webhooks using Azure Functions Respond to  Twilio Webhooks  using Azure Functions

    Azure Functions is built on the concept of Triggers and Bindings, and while there's a Twilio binding for sending SMS, there is no trigger for receiving messages or calls. However, Azure Functions does have an HTTP trigger which you can use to receive webhook requests from Twilio.

    In this tutorial, you will learn how to respond to Twilio webhooks using Azure Functions. You will learn what webhooks are, how to set up an Azure Function, and then use your Azure Function app to respond to a Twilio SMS webhook.

    Prerequisites

    You will need the following things to follow along:

    Read More
  • By Niels Swimberghe
    Use XML Literals in Visual Basic .NET to generate TwiML Use XML Literals in Visual Basic .NET to generate TwiML

    While JSON and YAML have become very popular data serialization languages, XML is still everywhere. XML is used on the HTML page you are reading right now. XML is used in your .NET project files and MSBuild scripts. Twilio also has their own flavor of XML called TwiML, but more on that later.

    If you need to work with XML and are a Visual Basic .NET (VB) developer, then you're in luck because VB has a built-in feature for generating XML called XML Literals. In this tutorial, you'll learn how to generate TwiML with XML Literals with an ASP.NET Core Minimal API.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Niels Swimberghe
    How to generate TwiML using Strings in C# Generate TwiML using Strings in C#

    Over the decades, C# has added different ways to create a string, each with their own benefit. In this tutorial, you'll learn how to generate TwiML using the different C# string features with an ASP.NET Core Minimal API and compare it to the object oriented way of generating TwiML.

    But first, let's get you up to speed on how Twilio uses webhooks and TwiML to respond to text messages and voice calls.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Niels Swimberghe
    Use Raw String Literals to generate TwiML in C# 11 Use Raw String Literals to generate TwiML in C# 11

    Over the decades, C# added different ways to create a string, each with their own benefit, and C# 11 is adding another way: Raw String Literals. There are many use cases for Raw String Literals, and one of those use cases is to generate TwiML, but more on that later. In this tutorial, you'll learn how to generate TwiML with Raw String Literals with an ASP.NET Core Minimal API.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Volkan Paksoy
    Forward Voicemails with Transcript to your Email using C# and ASP.NET Core Forward Voicemails with Transcript to your Email using C# and ASP.NET Core

    Whether you like it or not, phone calls are essential to our daily communications. However, sometimes nobody is available to take the call right there and then. Luckily, Twilio Programmable Voice lets you record voicemail so the caller can leave a message. But what if instead of having to call into a voicemail box, you could receive the voicemail and transcript in as an email instead? In this article, you will build a Twilio Voice app that sends voicemails and the call transcript to your email address using SendGrid.

    Prerequisites

    You'll need the following things in this tutorial:

    Read More
  • By Niels Swimberghe
    What's new in the Twilio helper library for ASP.NET (v6.0.0 - August 2022) What's new in the Twilio helper library for ASP.NET (v6.0.0 - August 2022)

    The Twilio helper library for ASP.NET (Twilio.AspNet) is a community-driven open-source project to make integrating Twilio with ASP.NET easier, for both ASP.NET Core and ASP.NET MVC on .NET Framework. The library helps you achieve common use cases and with the release of version 6, we're expanding the library's capabilities and improving existing features.

    Wondering what was previously introduced? You can read about v5.73.0 and prior releases here.

    What's new in Twilio.AspNet v6.0.0

    V6.0.0 is a major release of the Twilio.AspNet library because it contains breaking changes. Starting from this release, version numbers do not match the version of the Twilio .NET SDK.

    Here's an overview of the changes:

    🎉 NEW FEATURES

    • You can now add the TwilioRestClient to ASP.NET Core's dependency injection (DI) container, using the .AddTwilioClient method. This Twilio client will use an HttpClient provided by the HTTP client factory. You can find more information about this …
    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.