Last active
March 20, 2020 04:28
-
-
Save CyrusNajmabadi/e7224d82782f5c0b6b58f301cdf2be1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person | |
{ | |
public Person(int age, string name); | |
public int Age { get; } | |
public string Name { get; } | |
public virtual Person With(in Builder builder); | |
public ref struct Builder | |
{ | |
public int Age { get; set; } | |
public string Name { get; set; } | |
public bool HasAge { get; } | |
public bool HasName { get; } | |
} | |
} | |
public class Student : Person | |
{ | |
public Student(int age, string name, double gpa); | |
public double Gpa { get; } | |
public override Person With(in Person.Builder builder); | |
public virtual Student With(in Builder builder); | |
public ref struct Builder | |
{ | |
public Person.Builder Parent; | |
public int Age { get; set; } | |
public string Name { get; set; } | |
public double Gpa { get; set; } | |
public bool HasAge { get; } | |
public bool HasName { get; } | |
public bool HasGpa { get; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment