Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "As the NuGet
package names often do not match the namespaces within, the NuGet
package names are mentioned separately."
A block of code is set as follows:
public class Task { public int Id { get; set; } public string Title { get; set; } public int UserId { get; set; } } interface IService { Task GetTaskById(int id); Task[] GetAllTasks(); Task[] GetTasksById(int[] ids); Task[] GetTasksForUserId(int userId); Task[] GetTasksByTitle(string title); Task[] GetTasksByTitleForUserId(string title, int userId); }
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold, as shown:
private KeyValuePair<string, string>? GetCustomAuth(IRequest httpReq)
{
var hasCredentials = httpReq.Dto as IHasCredentials;
if (hasCredentials == null)
{
return null;
}
var userName = hasCredentials.UserName;
var password = hasCredentials.Password;
if (string.IsNullOrWhiteSpace(userName) ||
string.IsNullOrWhiteSpace(password))
{
return null;
}
return new KeyValuePair<string, string>(userName, password);
}
Any command-line input or output is written as follows:
Hello John Doe!
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "One of the key points of ServiceStack is the Code-First approach."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.