Chapter 12 dependencies resolved
MODIFY
src/Chapter12/Listing12.17.UsingATupleCreateFactoryMethods.cs
src/Chapter12/Listing12.17.UsingATupleCreateFactoryMethods.cs
@@ -2,7 +2,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_17
{
#pragma warning disable 0219 // Disabled warning for assigned but never
// used variables for elucidation
- using Chapter08.Listing08_11;
+ using Contact = Chapter12.Contact;
public class Program
{

MODIFY
src/Chapter12/Listing12.43.CovarianceUsingTheOutTypeParameterModifier.cs
src/Chapter12/Listing12.43.CovarianceUsingTheOutTypeParameterModifier.cs
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_43
{
using Chapter08.Listing08_02;
- using Contact = Chapter12.Listing12_43_Dependencies.Contact;
+ using Contact = Chapter12.Contact;
interface IReadOnlyPair<out T>
{
@@ -89,76 +89,3 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_43
}
-
-//Dependencies
-namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter12.Listing12_43_Dependencies
-{
- using Chapter08.Listing08_02;
- using System;
-
- interface IPerson
- {
- string FirstName
- {
- get;
- set;
- }
-
- string LastName
- {
- get;
- set;
- }
- }
-
- public class Person : IPerson
- {
- public Person(string firstName, string lastName)
- {
- FirstName = firstName;
- LastName = lastName;
- }
- public string? _FirstName;
- public string FirstName
- {
- get => _FirstName!;
- set => _FirstName = value ?? throw new ArgumentNullException(nameof(value));
- }
- public string? _LastName;
- public string LastName
- {
- get => _LastName!;
- set => _LastName = value ?? throw new ArgumentNullException(nameof(value));
- }
- }
-
- public class Contact : PdaItem, IPerson
- {
- public Contact(string name)
- : base(name)
- {
- }
-
- private Person Person
- {
- get { return _Person!; }
- set { _Person = value ?? throw new ArgumentNullException(nameof(value)); }
- }
- private Person? _Person;
-
- public string FirstName
- {
- get { return Person.FirstName; }
- set { Person.FirstName = value; }
- }
-
- public string LastName
- {
- get { return Person.LastName; }
- set { Person.LastName = value; }
- }
-
- // ...
- }
-
-}

Chapter 12 dependencies resolved