Create South African test data with NBuilder and Faker

I’ve recently read an excellent article by Jerrie Pelser about using NBuilder and Faker.Net to generate test data for your .Net project – something I actually need on a regular basis.

However, I needed data that looked a bit more South African so, I’ve added some South African flavour to Faker.Net. You can now generate South African names, surnames, provinces and actual valid ID numbers for use as test data in your project.

In the following example I generate 100 client records with random South African names, surnames, provinces and ID numbers:

Code Snippet
  1. protected override void Seed(ApplicationDbContext context)
  2. {
  3.     var customers = Builder<Client>.CreateListOfSize(100)
  4.         .All()
  5.             .With(c => c.Firstname = Faker.SouthAfrican.Firstname())
  6.             .With(c => c.Lastname = Faker.SouthAfrican.Lastname())
  7.             .With(c => c.Province = Faker.SouthAfrican.Province())
  8.             .With(c => c.IdNumber = Faker.SouthAfrican.IdNumber())
  9.         .Build();
  10.     context.Clients.AddOrUpdate(c => c.Id, customers.ToArray());
  11. }

You can get the code on Github.

Resources used for this article:

Office 365 API – Authentication & Setup

In our last article, we took a 10,000 foot view of what Office 365 has to offer. The article also made note of the Office 365 API, which enables developers to integrate with and use their users’ Office 365 data.

Before we can access the users’ data, we’ll need to authenticate our Office app and make sure it has the required permissions to access said data. This is accomplished by using single sign-on with Azure AD. The Office 365/Azure AD authentication uses OpenID Connect and OAuth 2.0, which is an open standard and if you’ve ever authenticated using either Facebook, Twitter or a Google account, the process of authenticating with Azure AD will be very familiar to you.

For the purpose of this article, we’ll only focus on authenticating using the new Office 365 Unified API. Although it is still only in preview, it will very shortly become the de facto method to access Office 365 data.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

Office 365 for developers – What, How, Where?

With Build and Ignite behind us we’ve seen some pretty incredible things from Microsoft, from mobile to virtual reality. If you haven’t watched the Build keynote or some of the sessions yet, I encourage you to do so.

Office 365 for the future

These are very exciting times, especially for MS Office developers. Satya Nadella, CEO of Microsoft, confirmed that “The most strategic developer surface area for us is Office 365“.

This means that the Office 365 platform is one of the most important areas for Microsoft as part of their vision for the future. It’s also an indication that Microsoft feels that developers need to embrace Office 365 in order for it to be an even bigger success.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

Graphics formats for Microsoft Office add-ins

Chances are that in the majority of Microsoft Office add-ins, you’ll be using at least one ribbon or command bar button. I do not know about you, but I can sometimes get hung up about which icon to use and deciding on which image will convey more accurately the task that will be performed once the user clicks on said ribbon or command bar button.

In today’s article, we’ll explore the various graphic formats supported by MS Office components and how to make them appear the best they can be.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

.

Windows and Office security guide for Office developers

Office add-in security and certificates has always been somewhat of a daunting task. In today’s article we’ll first investigate code-signing certificates and why they are used. We’ll then take a closer look at the Office Trust Center function and settings.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

Bootstrap for ASP.NET MVC Q&A

Thank you to everyone who bought my book Bootstrap for ASP.NET MVC!

If you have any questions about the content in the book or have any questions regarding ASP.Net MVC and Bootstrap, please feel free to use the comments on this blog post to ask it.

 

How to determine when a user has read an Outlook message

In today’s article we’ll look at how to determine when a user has read an Outlook mail message. There are a variety of ways a message can be marked as read, e.g.:

  • The user right-clicked the message in the Explorer and selected the “Mark as Read” context-menu item; or
  • The mail message was opened in an inspector window, usually by double-clicking the message in the Outlook Explorer; or
  • Viewing the message in the Outlook reading pane.

We’ll create an Outlook add-in that illustrates the various methods of responding to the the fact that a user has read an e-mail in Outlook.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

Working with Outlook HTMLBody – a guide for Office developers

If you’ve ever tried to design an attractive and somewhat complex e-mail message using Microsoft Outlook and HTML, chances are you very quickly realized that the Outlook mail message body format performs rather differently than a normal web browser.

<p align="justify">Read more at <a href="https://www.add-in-express.com/creating-addins-blog/2015/02/23/outlook-htmlbody-guide/">Add-in Express</a>.</p>

<blockquote>
  <p align="justify">To see all my recent Add-in Express blog posts visit my <a href="http://www.add-in-express.com/creating-addins-blog/author/pieter-van-der-westhuizen/">author page.</a></p>
</blockquote>

How to implement auto-update for Office add-ins

Automatic updates for software applications’ mobile apps have become an everyday occurrence for most users. For a user it provides a level of comfort to know that their software is always up to date with the latest and greatest version. It could also be a source of irritation for many users depending on the frequency of updates – not many users would be happy upgrading to a new version every day.

Of course, Office Add-in is no exception and it is also necessary to deploy a new version of your add-in from time to time.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.

How to get unread mail in Outlook: C# code examples

Finding and filtering items in Outlook can be done in a variety of ways and in this article we’ll focus on ways to retrieve unread mail from Outlook.

The following C# code examples demonstrate different techniques of getting unread mail items in Outlook.

Read more at Add-in Express.

To see all my recent Add-in Express blog posts visit my author page.