18
1
using System;
2
3
var product = new Product("name");
4
5
var newProduct = new Product(){
6
Name = "newName"
7
};
8
9
public class Product{
10
public string Name {get;init;}
11
12
public Product(){
13
}
14
15
public Product(string name){
16
Name = name;
17
}
18
}
Cached Result
Compilation error (line 11, col 4): The name 'Console' does not exist in the current context
Compilation error (line 12, col 23): The name 'Console' does not exist in the current context
Compilation error (line 16, col 4): The name 'Console' does not exist in the current context
Compilation error (line 17, col 4): The name 'Console' does not exist in the current context
Compilation error (line 18, col 4): The name 'Console' does not exist in the current context
Compilation error (line 12, col 23): The name 'Console' does not exist in the current context
Compilation error (line 16, col 4): The name 'Console' does not exist in the current context
Compilation error (line 17, col 4): The name 'Console' does not exist in the current context
Compilation error (line 18, col 4): The name 'Console' does not exist in the current context