Posts

Showing posts from April, 2020

Writing, Debugging, and Testing Functions

Image
C# - Writing, Debugging, and Testing Functions , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE Introduction This chapter is about writing functions to reuse code, debugging logic errors during development, logging exceptions during runtime, and unit testing your code to remove bugs and ensure stability and reliability. This chapter covers the following topics: Writing functions Debugging during development Logging during runtime Unit testing Writing functions A fundamental principle of programming is Don't Repeat Yourself (DRY). While programming, if you find yourself writing the same statements over and over again, then turn those statements into a function. Functions are like tiny programs that complete one small task. For example, you might write a function to calculate sales tax and then reuse that function in many places in a financial application. Like programs, functions usually have inputs and outputs. They are sometime

Workspace npm dependencies - Angular

Workspace npm dependencies - Angular , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE Workspace npm dependencies The Angular Framework, Angular CLI, and components used by Angular applications are packaged as npm packages and distributed via the npm registry. You can download and install these npm packages by using the npm CLI client, which is installed with and runs as a Node.js® application. By default, the Angular CLI uses the npm client. package.json Both npm and yarn install the packages that are identified in a package.json file. The CLI command ng new creates a package.json file when it creates the new workspace. This package.json is used by all projects in the workspace, including the initial app project that is created by the CLI when it creates the workspace. Initially, this package.json includes a starter set of packages, some of which are required by Angular and others that support common application scenarios. You add packages to

Controlling Flow and Converting Types

C# - Controlling Flow and Converting Types , ANGULAR WITH CORE .NET AND MVC RAZOR ENGINE Introduction This chapter is all about writing code that performs simple operations on variables, makes decisions, repeats blocks of statements, converts variable or expression values from one type to another, handles exceptions, and checks for overflows in number variables.      This chapter covers the following topics: Operating on variables Understanding selection statements Understanding iteration statements Casting and converting between types Handling exceptions Checking for overflow