-
Intro to WebAPI - One of the most powerful project types in C#
-
How To Call An API in C# - Examples, Best Practices, Memory Management, and Pitfalls
Console Programs on Repl.it
- C# & SQL Multiple Choice Quiz
- C# Multiple Choice Quiz
- Music & Politics
- Nested If/Else
- Full names printed out
- Full names tracker
- Loop through a list of first names
- Methods DRY
- Type conversion
- C# Quiz Basic
- C# Quiz Do loop
- Dream Team 1992
- Dream Team 1992 Version 2
- Redwoods
- Redwoods Version 2
- United Kingdom Multidimensional Arrays
- Medical Future (dictionaries)
- Inheritance & Interfaces
- Events
- Cat model with extension methods
- Address Book
- Battleship Project
- Static Class Demo
- Instantiated Class Demo
- Property Types
- C# Quiz
- C# Quiz methods
- Guest List
- Trees Polymorphism
- Image size
- Time Keeper
- Post Likes
- FizzBuzzes
- Generics
- FizzBuzz Genric
- Adventure Game
- Adventure Game Refactored
- Number Guessing Game
- Word Guessing Game
- Madlip
- Tip Calculator
-
Introduction to ASP.NET MVC in C#: Basics, Advanced Topics, Tips, Tricks, Best Practices, and More
-
ASP.NET MVC Data Access in C# - The complete data path from database to display and back
C# = is a programming language created by Anders Hejlsberg for Microsoft It created around 2000. .NET = is a framework for creating Windows Applications. Other languages are supported by the framework, like F# and VB NET
- NET has two elements:
- Common Language Runtime (CLR): The C# language is compiled to IL code (Intermediate Language).
- In turn, the CLR translates this IL code to native code at runtime. This is known as Just In Time compilation (JIT)
Main Method = Is the entry point of the application. It is a "quarter back method" it tells what the other methods should do (Console Apps)
Solution = is a container that holds different projects
Assembly = is a single unit of .NET application deployments
Namespace = is a collection of classes
Classes = see further down
Using statements = shortcut code
using { ... }
Using statement usually go with Interfaces (IDisposable).
- A using statement shuts down the class at the end of a
}
as well as shutting down a connection to a database
References = bring in code
Static Classes = one copy for the entire lifetime of the application. Storing data inside a static class is not a good idea, because it increases the application's memory footprint. They aren't instantiated
- Static means “associated with the class, not an instance”.
- Static member is always accessed by the class name, rather than the instance name, like Forest.Area.
- Static method cannot access non-static members.
- Static constructor is run once per type, not per instance. It is invoked before the type is instantiated or a static member is accessed.
Auto Properties = are more common because auto-properties target many types of applications WinForms, WPF, ASP.NET MVC...
Constructor = (ctor) is a method that is not static. It is part of the instantiated class. A constructor is a special type of method when a "car/house" (object) is built. It does not return anything
Articles
Articles
Abstract Classes and Interface
Value Types: hold actual data
- int
- double
- bool
- char
Reference Types: refer to a location in memory
-
Classes
-
Objects
-
Arrays
-
Indexers
-
Interfaces
-
Every class is derived from Object — even user-defined classes.
-
Value types and strings also inherit from Object:
-
Strings are immutable: they cannot be changed after they are created. Anything that appears to modify a string actually returns a new string object.
- First Contributions
- First Timers Only
- Code Triage
- Updating Microsoft Documentation - Contributing to Open Source
- How to Start Contributing to Open Source
- Open Source Guides
- Open Source
- Up for Grabs
Class library takes care of data access in Razor Pages (and other web applications) once
-
Connecting to a database is a two-way process. A user interface should not talk directly to a database.
- When a application is talking to a database or getting information from a database, there needs to be a
Model
(directory) - A model is a class with a few properties. The model holds data together.
- When a application is talking to a database or getting information from a database, there needs to be a
-
Databases
(directory) has database/data access code. This where there is direct communication with a database -
Data
(directory) Classes inData
folder will talk to classes int theDatabases
folder which talks to theSQL
database- Classes in the
Data
folder are what the user interface will talk to - The user interface may call a
Data
class, and a method inside the class can figure out the query it needs to get information- And then call class in
Databases
class
- And then call class in
- Classes in the
- SQL Data Tools In C#
- ASP.NET MVC Data Access in C# (YouTube)
- Scientist & Transport Article
- Dream Team 1992 Article
- SQL Database Wrap Up Article
- Database notes on Repl.it
- Connection Strings
- SQLite Browser
- SQL Fiddle
- Cosmos DB
- MySQL
- NoSQL Database Guide
- From MongoDB to Postgres
- Entity Framework
> #r "C:\Users\yourusername\source\repos\BirdWatcher\BirdWatcher\BirdWatcher.dll" = your project will be linked to C# Interactive (REPL)
Control + Shift N = start a new project
Alt UP ARROW / DOWN ARROW = move a single or multiple lines of code up or down
control + j = brings back intellisense
control + h = replace text with
control + x = cut a single line
control + kc = // comment several lines out
control + . = // using System ...
control + k = uncomment several lines out
shift + tab = unindent lines of code
control shift b = complie (build)
control shift d = copy and past previous line
cw + tab tab = Control.WriteLine() (press tab twice)
try tab = try block created (works for if, while, do, for and foreach statements as well)
ctor = Makes a constructor
prop + tab tab = declare auto-properties
propfull + tab tab = declare full on properties
control + tab = get back to another file
type /// private static void addTwoNumbers ... = add /// <summary> comments </summary>
Control R + R = change name of a class
Control + Alt + Click = multiple line selection
Control + Home = Arrive at top of page (without scrolling)
Control + End = Arrive at end of page (without scrolling)
Control . = Recognize a class from another namespace
Control R, A = run test
mvcaction4 + tab = create a ActionResult (MVC)
In case mvcaction4 snippet does not work click here
F9 = add break point
F5 = run in debug mode
F10 = step over
Shift + F11 = step out of
Shift + F5 = exit debug mode