Build the future of communications.
Start Building for Free

.net core posts

  • By Sam Nasr
    Recognizing and Validating Phone Numbers Using Azure Computer Vision, Twilio Lookup, and .NET Core lookup-computer-vision.png

    Developers who work with images often face the problem of extracting and verifying phone numbers that appear in images. There are billions of pages of documents that exist only as image files. Getting usable data out of them is a challenge — especially when the data needs to conform to specific rules to be reliable.

    Optical character recognition (OCR) applications are great, but they can’t always take the step of identifying the type of information represented by the characters they’re recognizing. And in many cases, OCR applications are large, standalone applications requiring significant computing resources to run at scale.

    Microsoft Azure Computer Vision solves these problems by providing cloud-based intelligent image processing. Developers can upload images to the cloud through an API and have Computer Vision perform the work of converting images to data.

    When the data includes phone numbers, developers can use the Twilio Lookup API to verify the …

    Read More
  • By AJ Saulsberry
    Using Twilio Lookup in .NET Core WPF Applications using-lookup-dot-net-wpf (1).png

    There are a lot — really a lot — of applications collecting phone numbers. Those numbers all need to be validated and verified. It makes sense to do some of the validation on the front end where an end user or customer service agent can correct errors without waiting on a round trip to a server.

    Application front-ends can determine if the contents of a specific field are “phone number-ish” by using data types, regular expressions, input masks, and odd bits of JavaScript. But they can’t tell if the input is a real phone number without checking the input against a list of real phone numbers.

    Twilio Lookup makes it easy to validate phone numbers for both web applications and applications developed with .NET Core Windows Presentation Foundation (WPF), an open-source UI framework for creating desktop client applications for Windows.

    Twilio provides helper libraries for a variety of programming languages …

    Read More
  • By Jeff Rosenthal
    Getting Started with gRPC in .NET Core getting-started-with-grpc (1).png

    As a developer in the 21st century, you are often faced with addressing communications between various modules of your project. Internal, or “intra-process” communications, are often handled with loosely coupled messages, but forging beyond the process boundary can often be challenging. Adding to this requirements for scalability, testing, and security can often leave you scratching your head in search of a better way.

    Over the years Microsoft has often revealed various technologies to handle this niche. Remote Procedure Calls (RPC), DCOM, Named Pipes, and Windows Communication Foundation (WCF) are examples of technologies that have fit the bill in the past. A new technology is now making the scene, this time with the assistance of Google.

    For over 10 years now, Google has implemented an infrastructure to interface the vast number of microservices it oversees. In 2015, they set out to create the next version of this technology and shared what …

    Read More
  • By Mitchel Sellers
    Unit Testing Twilio Programmable SMS in .NET Core with xUnit, Moq, and Visual Studio 2019 unit-testing-sms-xunit-moq.png

    Testing your C# code is important, and it’s even more important when your code relies on external services. Writing tests will not only help you catch bugs, it will help you write better code by thinking about factors that affect the structure and resilience of your software.

    Visual Studio 2019 includes some great tools for creating and running unit tests, and you can put them to work without a lot of setup or configuration. Whether you’re writing a new app or trying to improve a brownfield program, it’s easy to integrate unit testing into your workflow.

    Twilio understands the importance of testing and provides resources for you to use when you’re creating unit tests for code that interacts with Twilio products, like Programmable SMS. To show you how easy it is to get started, this post will walk you through the process of building and testing a .NET Core console …

    Read More
  • By Gunnar Peipman
    Building a Blazing Fast Object-to-Object Mapper in C# with .NET Core 3.1 building-blazing-fast-object-mapper.png

    Object-to-object mapping is used mostly for copying properties of one object to another, typically for transforming an object from one type to another. There are many use cases. For example, object transformation can help prevent overposting attacks from succeeding by intermediating between APIs and user interfaces exposed to the world and private data models on back-end servers.

    You can build your own minimalistic object-to-object mapper with C# and .NET Core without writing a lot of code. This post will show you various approaches, one of which is used in production for an online action game with a massive load.

    There are also professional mappers available that come with many useful features the minimalistic code doesn’t provide. This post will show you how to implement AutoMapper, one of the most popular object-to-object mapping libraries.

    The mapping techniques demonstrated here were originally developed in 2011. At the time, C# Reflection was even …

    Read More
  • By AJ Saulsberry
    Validating Phone Numbers Effectively with ASP.NET Core 3.1 Razor Pages Validating Phone Numbers Effectively In Razor Pages

    Data validation is an essential part of application design and development, and telephone numbers are as tricky to validate as they are ubiquitous. In many cases a phone number will be the primary way your organization communicates with its customers. Whether the communication will be by voice, SMS, or messaging app, having a correct phone number is a requirement.

    Developers using .NET Core and the .NET Framework can do validation for a number of different data types, including phone numbers, with the System.ComponentModel.DataAnnotations namespace, but the PhoneAttribute class has its limitations. To learn more, see the .NET Data Validation section of the previous Twilio Blog post on this subject: Validating phone numbers effectively with C# and the .NET frameworks.

    Fortunately, the libphonenumber-csharp open source library provides extensive resources for validating and manipulating phone numbers of all types and it’s conveniently available as a NuGet package. This post shows …

    Read More
  • By Corey Weathers
    Tips for Getting Started with Blazor Tips for Getting Started with Blazor

    As a .NET developer, I've been excited to explore all of the great things that came with the release of .NET Core 3.0. I have spent time playing with one of the newly launched technologies, Blazor, which allows me to build web applications targeting web assembly using HTML, CSS and C#.

    In my excitement, I went to see what the fuss was about. Following the instructions on, I updated Visual Studio 2019, installed the Blazor project templates, created a new Blazor app project, and then realized there were some choices I needed to make in order to build my shiny Blazor web application. As I made some choices and got going with my project I continued to see more and more places where I wished some things had already existed to help make development easier.

    As a result, I've put together this list of tips to help sort …

    Read More
  • By Corey Weathers
    Making Phone Calls with Twilio & Blazor Header Image.png

    It's an exciting time to be a .NET developer as .NET Core 3.0 has reached general availability. With this release comes Blazor, Microsoft's take on building web applications using WebAssembly and the technologies you already know and love such as HTML, CSS, and C#. I published a prior blog post when Blazor was still in active development. It's time to join the release party and share our excitement about Blazor with Twilio and C#.

    The first thing you should do when a new product gets announced is tell your friends, right - but what if we phoned them with a special note sharing our excitement? Let's build a web application that does exactly that - it uses Twilio to phone a friend, and is powered by Blazor.

    Installing Our Developer Tools

    Now in order to follow along - you'll need a few things first. You'll want to grab …

    Read More
  • By Layla Porter
    Rainy with a chance of Azure Cloud Rainy with a chance of cloud

    We all have good days and bad days. On a good day, we may be filled with positive thoughts and on a bad day, we may forget that anything was ever positive!

    gif of cartoon animal crying in the rain

    In this post, we will use Twilio to text your positive thoughts and affirmations to an Azure Function and save them in Azure Table Storage. We will then create a timer-based function that will send a random happy thought from the table storage via SMS to your friends.

    This post assumes some basic knowledge of C# and RESTful APIs.

    To get started, we will need:

    Read More
  • By Layla Porter
    Daily Dog with C#, WhatsApp and Azure functions 822m66DdV5S5TrfkutIagXi-tELxwMf92-KOdnf64XbhS8GoCdTYklLhMJiNKi4QTNCZ_nb50f7I9582qI1iZcOiiJ1yuOBIejZ5T5nNjn0QyoKQWY0v843XjJvxYPum-kQsq0Q7

    I love Bing Image of the day, it always makes me smile! I also love dogs, so I thought why not combine the two and create an app that sends a daily dog picture via WhatsApp.

    This post will take you through all the steps to create an azure scheduled function in C#, make a call to the Dog API to retrieve a photo and then send the returned image to a number via the Twilio API for WhatsApp.

    This post assumes some base knowledge of C# and RESTful APIs.

    To get started, we will need:

    Create an Azure Function

    From the Azure portal, click the Create a resource button, …

    Read More
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.