mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-03-25 22:04:39 +01:00
Initial commit
This commit is contained in:
parent
5108079993
commit
b73591d14c
|
|
@ -7,7 +7,7 @@ public class Book
|
|||
public Book() { } // For use with initialization syntax.
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public Book(string isbn, string title)
|
||||
public Book(string? isbn, string? title)
|
||||
{
|
||||
Isbn = isbn;
|
||||
Title = title;
|
||||
|
|
|
|||
|
|
@ -169,10 +169,11 @@ Book book = new()
|
|||
};
|
||||
*/
|
||||
Book book = new(isbn: "978-1803237800",
|
||||
title: "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals");
|
||||
|
||||
book.Author = "Mark J. Price";
|
||||
book.PageCount = 821;
|
||||
title: "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals")
|
||||
{
|
||||
Author = "Mark J. Price",
|
||||
PageCount = 821
|
||||
};
|
||||
|
||||
WriteLine("{0}: {1} written by {2} has {3:N0} pages.",
|
||||
book.Isbn, book.Title, book.Author, book.PageCount);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public class Book
|
|||
public Book() { } // For use with initialization syntax.
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public Book(string isbn, string title)
|
||||
public Book(string? isbn, string? title)
|
||||
{
|
||||
Isbn = isbn;
|
||||
Title = title;
|
||||
|
|
|
|||
|
|
@ -169,10 +169,11 @@ Book book = new()
|
|||
};
|
||||
*/
|
||||
Book book = new(isbn: "978-1803237800",
|
||||
title: "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals");
|
||||
|
||||
book.Author = "Mark J. Price";
|
||||
book.PageCount = 821;
|
||||
title: "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals")
|
||||
{
|
||||
Author = "Mark J. Price",
|
||||
PageCount = 821
|
||||
};
|
||||
|
||||
WriteLine("{0}: {1} written by {2} has {3:N0} pages.",
|
||||
book.Isbn, book.Title, book.Author, book.PageCount);
|
||||
|
|
|
|||
Loading…
Reference in a new issue