Initial commit

This commit is contained in:
Mark J Price 2022-09-17 16:50:07 +01:00
parent 5108079993
commit b73591d14c
4 changed files with 12 additions and 10 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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);