Build the future of communications.
Start building for free
  • By AJ Saulsberry
    C#と.NETフレームワークで電話番号を検証する方法 C#と.NETフレームワークで電話番号を検証する方法

    この記事はAJ Saulsberryこちらで公開した記事(英語)を日本語化したものです。


    .NET Frameworkや.NET Coreなどのアプリケーション開発フレームワークにはデータ検証機能があるため、標準のデータ型は確実かつ簡単に処理できます。.NETフレームワークで電話番号を検証することも可能ですが、国際化(i18n)など、使用できる機能が制限されています。



    C#と.NETフレームワークで構築されたソフトウェアの一般的な設計パターンでは、クラスオブジェクトを使用してデータを格納します。これは、Model View Controller(MVC)ライブラリを使用するWebアプリケーションでは標 …

    Read More
  • By AJ Saulsberry
    Asynchronous JavaScript: Tools, Techniques, and Case Studies async-js-tools.png

    There are a number of asynchronous tools in JavaScript, and there are also asynchronous tools in popular libraries that extend JavaScript. And there are many uses for these technologies.

    You can learn about the fundamental asynchronous JavaScript tools in posts here on the Twilio blog: There is a post devoted to each technology, and they’re summarized in the post:

    Asynchronous JavaScript: A Comprehensive Guide

    When you’re learning any new programming tool or technique it’s helpful to have examples of how to use the code in realistic situations, so in addition to covering the fundamentals we have a series of posts showing practical demonstrations of how to use asynchronous code.

    Confirming SMS Message Delivery with RxJS Observables, Node.js, and Twilio Programmable SMS

    You’ll learn a couple of important things from this post: 1) how to create an Observable wrapper around an API request so your code gets a notification when the …

    Read More
  • By AJ Saulsberry
    Asynchronous JavaScript: A Comprehensive Guide async-js-guide.png

    Are you learning JavaScript and trying to understand asynchronous programming? Are you currently a JavaScript programmer who needs an overview of the asynchronous features of JavaScript? Or are you trying to decide which asynchronous technique best suits a programming task you’re trying to accomplish?

    If you identify with any of these descriptions — or even if you’re just looking for a refresher on a specific asynchronous technique — the Asynchronous JavaScript series here on the Twilio blog can help. The series covers everything from callbacks to the async and await keywords; and it even includes RxJS Observables, a widely-used external library for handling asynchronous tasks.

    Each of the posts includes complete source code for a runnable Node.js project demonstrating the technique covered in the post, and the posts are unified by a common case study so you can compare different approaches to the same task. The code for each post …

    Read More
  • By AJ Saulsberry
    Using RxJS Observables With JavaScript Async and Await rxjs-observables-async-await.png

    There are a number of resources for handling asynchronous tasks in JavaScript, each with its own strengths and suitability to specific tasks. Sometimes a single tool is all that’s necessary to accomplish a task, but there are programming challenges which can be handled more effectively by combining the capabilities of tools.

    RxJS Observables enable you to operate on sequences of data, like the results of a REST API call, as if they were events, acting on new and updated data from the Observable object when the change occurs. They’re great tools to use when the timing of data events is unpredictable, like when you’re dealing with slow or occasionally unreliable web services.

    JavaScript Promises are useful when you need a placeholder for the results of a task that might fail and need to respond differently depending on the task’s success or failure. Promise objects can be used with the JavaScript …

    Read More
  • By AJ Saulsberry
    Getting Started With 2FA Using Twilio Authy and ASP.NET Core authy-asp-net-core-angularjs.png

    Update January 2022

    For new development, we encourage you to use the Verify API instead of the Authy API. The Verify API is an evolution of the Authy API with continued support for SMS, voice, and email one-time passcodes, an improved developer experience and new features including:

    This blog post uses the Authy API. Any new features and development will be on the Verify API. Check out the FAQ for more information and Verify API Reference to get started.

    Security is important, just ask any blue check Twitter user. Rolling your own authentication system is time consuming and fraught with peril. So how do you move beyond user credentials that consist of nothing more than an email address and a …

    Read More
  • By AJ Saulsberry
    Adding Asynchronous Processing to ASP.NET Core 3.1 Razor Pages Applications Built With the MVVM Design Pattern mvvm-asynchronous.png

    Adding Asynchronous Processing to ASP.NET Core 3.1 Razor Pages Applications Built With the MVVM Design Pattern

    If you’re building web applications with ASP.NET Core you’re likely to be looking for ways to make them performant as they scale. Using the asynchronous features of C#, ASP.NET Core, and Entity Framework Core is a good way to do this.

    Making hot code paths asynchronous is one of Microsoft’s ASP.NET Core Performance Best Practices. A hot code path is one that is “...frequently called and where much of the execution time occurs.”

    There are two categories of hot code paths where it’s particularly important to use asynchronous processing in data-driven ASP.NET Core applications:

    1. Razor Pages controller actions – the entire call stack is asynchronous, so you can benefit from that by making your controller actions asynchronous.
    2. Data access actions – Entity Framework Core includes asynchronous features to improve the performance of code …
    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 AJ Saulsberry
    Using C# Interfaces as View Models With ASP.NET Core 3.1 Razor Pages in MVVM Design csharp-interfaces-mvvm.png

    When you build web applications with Razor Pages using the Model-View-ViewModel (MVVM) design pattern you can use C# Interfaces and the .NET Dependency Injection middleware to abstract your application’s data repositories. This approach reduces class coupling and makes it easier to create unit tests. It also makes it easier to maintain the application and expand its scope as business requirements become more complex.

    It’s natural to look for other places where you can use interfaces to create abstractions. In MVVM design, a logical place to look is the View Model layer; these classes are typically used to provide both the data model for the PageModel class and the return types for the data repositories.

    This post will show what using interfaces for view models would look like using a case study application and it will demonstrate an important limitation of model binding. It will also offer some reasons why view …

    Read More
  • By AJ Saulsberry
    Using Interfaces and Dependency Injection for Inversion of Control in ASP.NET Core 3.1 Razor Pages Projects Built with the MVVM Design Pattern interfaces-di-mvvm (1).png

    The Model-View-ViewModel design paradigm is useful for building web applications with ASP.NET Core Razor Pages and ASP.NET Core MVC. Entity classes, data repositories, and view models work with data contexts, data binding, validation, and features of the ASP.NET Core middleware to create a comprehensive and extensible architecture.

    But it is important to use additional features of C# and the .NET Extensions APIs to prevent the structure of an MVVM web app from becoming rigid, making it difficult to modify as the requirements for the application change and grow. At the same time, you’ll also make it easier to build unit tests for your application, helping you ensure it continues to work correctly as you modify existing features and add new ones.

    C# Interfaces and Dependency Injection from the .NET Extensions namespace can be used to reduce the class coupling that occurs when you use concrete types to create new instances …

    Read More
  • By AJ Saulsberry
    Using the Latest Twilio NuGet Package with Legacy Versions of the .NET Framework twilio-nuget-legacy-dot-net.png

    Developers have a natural inclination to work with the latest and greatest technologies; new libraries, language features, and tools are some of the things that keep the profession interesting. Production environments, on the other hand, often lag behind because of stability, compatibility, and cost considerations.

    Twilio understands both perspectives, so .NET developers who build software for Windows machines get the best of both worlds when they work with Twilio components. You can develop with the latest tools and use the most recent Twilio libraries and API capabilities while maintaining compatibility with legacy operating systems and .NET frameworks.

    This post will walk you through a quick case study project demonstrating how to code an application that can run on older Windows systems and legacy versions of the .NET Framework while using the latest version of Visual Studio 2019 and the newest Twilio NuGet package. You can use the code to test …

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