- Skapa en sida som är /about och i den vyn så har du 1 bild, en titel och en liten text. Denna kan ni lösa genom att skapa en aboutcontroller med en index action eller så utökar ni homecontrollern med en ny action som heter About.
- Gör om bilden du har i /about så att den är klickbar genom att använda dig av en
<a href="URL">
tag. Länken ska leda till google.com - Skapa en ny sida /contact där du har ett formular
som innehåller två stycken inputs av typ text (
) för namn och stad, samt en knapp (````). När användaren klickar på ”Submit” knappen så ska namnet och stad skickas till en action och dessa två ska även returneras och skrivas ut på contact sidan.
Anta att ni har en butik som säljer datorer, skrivare och tangentbord. Ni ska ha koll på varorna i lagret. Som butik ska man givetvis kunna sälja och köpa in varor. Listan med datorer som ska lagras lokalt i ett filsystem, medan skrivare och tangentbord hämtas från en webbtjänst.
- Vilka repositories skulle vara bra att ha?
- Ge exempel på metoder repositoryn ska ha
- Vilka services skulle vara bra att ha?
- Ge exempel på metoder som services har
- Vilka interfaces skulle vara bra att ha och varför?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Inspired by D.S. :) | |
/// </summary> | |
/// <param name="stringInput"></param> | |
/// <param name="numberOfChars"></param> | |
/// <returns></returns> | |
public static string Versatilizaastoosanon_v2(this string stringInput, int numberOfChars) | |
{ | |
// Check if numberofchars is 0 or below 0. If yes, return empty string. | |
if (numberOfChars <= 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace console_extension | |
{ | |
public static class IntExtension | |
{ | |
public static int Exp2(this int intInput) | |
{ |
- Skapa en Extension Method på string som skriver ut vartannat tecken i en string.
- Skapa en Extension Method på en integer som returnerar resultatet av värdet på integer * integer. T.ex. om talet är 5, ska resultatet bli 25, då 55=25. Är Talet 3, ska resultatet bli 9, då 33=9.
- Skapa en Extension Method som enbart skriver ut de första 2 bokstäverna i en string och dessutom i versaler. T.ex. Robert ska bli RO.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Human | |
{ | |
public string Name { get; set; } | |
public DateTime DateTimeOfBirth { get; set; } | |
} | |
public class NewPerson : Human | |
{ | |
public int CalculateAge() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<string> names = new List<string>() | |
{ | |
"Robert", | |
"Winston", | |
"Leonard", | |
"Jesko", | |
"Paul", | |
"Christian", | |
"Ellie", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace name_linq | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logapiurl = "http://localhost/im-demo/logapi/api/"; | |
var settings = new NodiniteLogEventSettings() | |
{ | |
LogAgentValueId = 20, | |
EndPointDirection = 0, | |
EndPointTypeId = 0, | |
EndPointUri = "Nodinite.Serilog.EventHubSink.Tests.Serilog", | |
EndPointName = "Nodinite.Serilog.EventHubSink.Tests", | |
ProcessingUser = "NODINITE", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logapiurl = "http://localhost/im-demo/logapi/api/"; | |
var settings = new NodiniteLogEventSettings() | |
{ | |
LogAgentValueId = 20, | |
EndPointDirection = 0, | |
EndPointTypeId = 0, | |
EndPointUri = "Nodinite.Serilog.EventHubSink.Tests.Serilog", | |
EndPointName = "Nodinite.Serilog.EventHubSink.Tests", | |
ProcessingUser = "NODINITE", |
NewerOlder