Juliandyce
✅ How to automate update-database
I am bilding a Web server but i have to typ in update-database how can i automate this in Blazor in the Program.cs file.
Im srry i cant be more specific because im new in this kind of stuff.
The tutorial i watch is just outdated the code changed a bit.
Tanks for your time and helping.
In the tutorial https://www.youtube.com/watch?v=JeLnR_ObHd8&t=4624s on 1:16:57 - 1:17:17
and i have the most recent Version of Microsoft Visual Studio if u also have it and it looks like that:
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
28 replies
❔ searching mistake
namespace App2
{
public class Program14
{
private static void SayHello()
{
Console.Write("What is ur name?"); string name = Console.ReadLine(); Console.WriteLine("Hello {0}", name); } static void Main(string[] args) { SayHello(); } } } CS1022 Type or namespace definition or end of file expected.
Console.Write("What is ur name?"); string name = Console.ReadLine(); Console.WriteLine("Hello {0}", name); } static void Main(string[] args) { SayHello(); } } } CS1022 Type or namespace definition or end of file expected.
3 replies
❔ Stringbuilder remove
i have problem with remove in the following program:
public class Program11
{
static void Main(string[] args) { StringBuilder sb = new StringBuilder("Hello World!", 50); //"Hallo Welt! start String //50 maximale Länge des Strings sb.Append(" How are u?"); // string hinten anfügen sb.AppendLine(); sb.AppendLine("I am fine!"); //string hinten anfügen zeilenumbruch sb.Insert(0, ":) ");
Console.WriteLine(sb.ToString()); sb.Remove(9, 14); Console.WriteLine(sb.ToString()); } }
} I wanna remove World witch should go from 9-14: output before remove; 🙂 Hello World! How are u? I am fine! output after remove: 🙂 Hello u? I am fine!
static void Main(string[] args) { StringBuilder sb = new StringBuilder("Hello World!", 50); //"Hallo Welt! start String //50 maximale Länge des Strings sb.Append(" How are u?"); // string hinten anfügen sb.AppendLine(); sb.AppendLine("I am fine!"); //string hinten anfügen zeilenumbruch sb.Insert(0, ":) ");
Console.WriteLine(sb.ToString()); sb.Remove(9, 14); Console.WriteLine(sb.ToString()); } }
} I wanna remove World witch should go from 9-14: output before remove; 🙂 Hello World! How are u? I am fine! output after remove: 🙂 Hello u? I am fine!
16 replies
❔ can someone explain the me the new operator
Especially the syntax behind this example:
Random rnd = new Random();
Can u compare the random before the = with int, string and the random after then says that a random number should be generated and new simply says that it should be regenerated every time the program is executed?
48 replies
❔ Erklärung
First of all: I am new to programming.
i want to only write nummers in a array that are greater then 10 which condition do i have to put into this programm: (at the ..........)
int[] numArray = { 1, 11, 22 };
Console.WriteLine("> 10 : {0}", Array.Find(numArray, .........));
7 replies
❔ Erklärung an Beispiel
First of all: I am new to programming.
I would like to get an explanation of the "Copy" command to the following example (as simple as possible):
int[] randNums = { 1, 4, 9, 2 };
Array.Sort(randNums);
Array.Reverse(randNums);
int[] srcArray = { 1, 2, 3 };
int[] destArray = new int[2];
int startInd = 0;
int length = 2;
Array.Copy(srcArray, startInd, destArray, 0, length);
PrintArray(destArray, "Copy");
And then of "Array.CreateInstance " too:
Array anotherArray = Array.CreateInstance(typeof(int),length);
ty
12 replies