diff --git a/README.md b/README.md index fe7b053..7323950 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ PM> Install-Package M31.FluentApi A package reference will be added to your `csproj` file. Moreover, since this library provides code via source code generation, consumers of your project don't need the reference to `M31.FluentApi`. Therefore, it is recommended to use the `PrivateAssets` metadata tag: ```xml - + ``` If you would like to examine the generated code, you may emit it by adding the following lines to your `csproj` file: @@ -502,6 +502,18 @@ To simplify adding documentation comments, a code action is available to generat ![doc-comments-action](https://raw.githubusercontent.com/m31coding/M31.FluentAPI/main/media/create-doc-comments-action.png) For reference, you can view the documented version of the `Student` class in [DocumentedStudent.cs](src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/DocumentedStudent.cs). The corresponding generated code is located in [DocumentedStudent.g.cs](src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.g.cs) + + +### Modifying an existing instance + +The static `FromExisting` method can be used to modify an existing instance: + +```cs +Student student1 = CreateStudent.WithFirstName("Alice").WithLastName("King"); +Student student2 = CreateStudent.FromExisting(student1).WithLastName("Queen"); +``` + +After calling `FromExisting`, the builder can continue from any step. To avoid mutating the original instance, create a copy constructor on the `Student` class and pass a copy to the `FromExisting` method. ### Lambda pattern @@ -592,4 +604,4 @@ In particular, if your IDE visually indicates that there are errors in your code This library is free. If you find it valuable and wish to express your support, please leave a star. You are kindly invited to contribute. If you see the possibility for enhancement, please create a GitHub issue and you will receive timely feedback. -Happy coding! +Happy coding! \ No newline at end of file diff --git a/media/create-doc-comments-action.png b/media/create-doc-comments-action.png index 4170cbd..3c46a59 100644 Binary files a/media/create-doc-comments-action.png and b/media/create-doc-comments-action.png differ diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/BuilderMethodsGeneration/BuilderGenerator.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/BuilderMethodsGeneration/BuilderGenerator.cs index 0ef6b32..5be9ff8 100644 --- a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/BuilderMethodsGeneration/BuilderGenerator.cs +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/BuilderMethodsGeneration/BuilderGenerator.cs @@ -23,6 +23,7 @@ public void Modify(CodeBoard codeBoard) List interfaces = new List(builderStepMethods.Interfaces.Count); interfaces.Add(CreateInitialStepInterface(builderStepMethods, codeBoard)); + interfaces.Add(CreateFromAnyStepInterface(builderStepMethods, codeBoard)); foreach (BuilderInterface builderInterface in builderStepMethods.Interfaces) { @@ -92,6 +93,19 @@ private Interface CreateInitialStepInterface(BuilderStepMethods builderStepMetho return initialStepInterface; } + private Interface CreateFromAnyStepInterface(BuilderStepMethods builderStepMethods, CodeBoard codeBoard) + { + Interface fromExistingInterface = + new Interface(codeBoard.Info.DefaultAccessModifier, codeBoard.Info.FromExistingInterfaceName); + + foreach (BuilderInterface @interface in builderStepMethods.Interfaces) + { + fromExistingInterface.AddBaseInterface(@interface.InterfaceName); + } + + return fromExistingInterface; + } + private void AddInterfacesToBuilderClass(List interfaces, Class builderClass, string prefix) { foreach (Interface @interface in interfaces) diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/ConstructorGenerator.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/ConstructorGenerator.cs index d4979a2..b1549db 100644 --- a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/ConstructorGenerator.cs +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/ConstructorGenerator.cs @@ -8,11 +8,17 @@ namespace M31.FluentApi.Generator.CodeGeneration.CodeBoardActors; internal class ConstructorGenerator : ICodeBoardActor { public void Modify(CodeBoard codeBoard) + { + CreateParameterlessConstructor(codeBoard); + CreateConstructorWithInstanceParameter(codeBoard); + } + + private static void CreateParameterlessConstructor(CodeBoard codeBoard) { string instanceName = codeBoard.Info.ClassInstanceName; string classNameWithTypeParameters = codeBoard.Info.FluentApiClassNameWithTypeParameters; - Method constructor = CreateConstructor(codeBoard.Info.BuilderClassName); + Method constructor = CreateParameterlessConstructorMethod(codeBoard.Info.BuilderClassName); ConstructorInfo constructorInfo = codeBoard.Info.FluentApiTypeConstructorInfo; if (codeBoard.Info.FluentApiTypeConstructorInfo.ConstructorIsNonPublic) @@ -59,7 +65,17 @@ public void Modify(CodeBoard codeBoard) constructor.AppendBodyLine(codeBuilder.ToString()); } - codeBoard.Constructor = constructor; + codeBoard.BuilderClass.AddMethod(constructor); + } + + private static void CreateConstructorWithInstanceParameter(CodeBoard codeBoard) + { + Method constructor = CreateConstructorWithInstanceParameterMethod(codeBoard.Info); + + CodeBuilder codeBuilder = new CodeBuilder(codeBoard.NewLineString); + codeBuilder.Append($"this.{codeBoard.Info.ClassInstanceName} = {codeBoard.Info.ClassInstanceName};"); + constructor.AppendBodyLine(codeBuilder.ToString()); + codeBoard.BuilderClass.AddMethod(constructor); } @@ -112,11 +128,22 @@ private static string CreateArgument( return "default!"; } - private static Method CreateConstructor(string builderClassName) + private static Method CreateParameterlessConstructorMethod(string builderClassName) { // private CreateStudent() MethodSignature signature = MethodSignature.CreateConstructorSignature(builderClassName); signature.AddModifiers("private"); return new Method(signature); } + + private static Method CreateConstructorWithInstanceParameterMethod( + BuilderAndTargetInfo info) + { + // private CreateStudent(Student student) + MethodSignature signature = MethodSignature.CreateConstructorSignature(info.BuilderClassName); + Parameter parameter = new Parameter(info.FluentApiClassNameWithTypeParameters, info.ClassInstanceName); + signature.AddParameter(parameter); + signature.AddModifiers("private"); + return new Method(signature); + } } \ No newline at end of file diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/FromExistingMethodGenerator.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/FromExistingMethodGenerator.cs new file mode 100644 index 0000000..aba308d --- /dev/null +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardActors/FromExistingMethodGenerator.cs @@ -0,0 +1,32 @@ +using M31.FluentApi.Generator.CodeBuilding; +using M31.FluentApi.Generator.CodeGeneration.CodeBoardElements; + +namespace M31.FluentApi.Generator.CodeGeneration.CodeBoardActors; + +internal class FromExistingMethodGenerator : ICodeBoardActor +{ + public void Modify(CodeBoard codeBoard) + { + // public static ICreateStudentFromAnyStep FromExisting(Student student) + // { + // return new CreateStudent(student); + // } + BuilderAndTargetInfo info = codeBoard.Info; + string methodName = "FromExisting"; + MethodSignature methodSignature = MethodSignature.Create( + info.FromExistingInterfaceName, + methodName, + null, + false); + methodSignature.AddModifiers(info.DefaultAccessModifier, "static"); + Parameter parameter = new Parameter( + info.FluentApiClassNameWithTypeParameters, + info.ClassInstanceName); + methodSignature.AddParameter(parameter); + Method method = new Method(methodSignature); + string parameterListInAngleBrackets = info.GenericInfo?.ParameterListInAngleBrackets ?? string.Empty; + method.AppendBodyLine( + $"return new {info.BuilderClassName}{parameterListInAngleBrackets}({info.ClassInstanceName});"); + codeBoard.BuilderClass.AddMethod(method); + } +} \ No newline at end of file diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/BuilderAndTargetInfo.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/BuilderAndTargetInfo.cs index fe9b12d..071d5e0 100644 --- a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/BuilderAndTargetInfo.cs +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/BuilderAndTargetInfo.cs @@ -30,6 +30,7 @@ internal BuilderAndTargetInfo( BuilderInstanceName = builderClassName.FirstCharToLower(); ClassInstanceName = fluentApiClassName.FirstCharToLower(); InitialStepInterfaceName = $"I{builderClassName}"; + FromExistingInterfaceName = $"I{builderClassName}FromExisting"; } internal string? Namespace { get; } @@ -45,4 +46,5 @@ internal BuilderAndTargetInfo( internal string BuilderInstanceName { get; } internal string ClassInstanceName { get; } internal string InitialStepInterfaceName { get; } + internal string FromExistingInterfaceName { get; } } \ No newline at end of file diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/CodeBoard.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/CodeBoard.cs index 2710b08..3b74b8f 100644 --- a/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/CodeBoard.cs +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeBoardElements/CodeBoard.cs @@ -30,8 +30,6 @@ private CodeBoard( Info = builderAndTargetInfo; CodeFile = codeFile; BuilderClass = builderClass; - Constructor = null; - StaticConstructor = null; InnerBodyCreationDelegates = new InnerBodyCreationDelegates(); TransformedComments = new TransformedComments(); GroupsToMethods = new Dictionary(); @@ -48,8 +46,6 @@ private CodeBoard( internal BuilderAndTargetInfo Info { get; } internal CodeFile CodeFile { get; } internal Class BuilderClass { get; } - internal Method? Constructor { get; set; } - internal Method? StaticConstructor { get; set; } internal InnerBodyCreationDelegates InnerBodyCreationDelegates { get; } internal TransformedComments TransformedComments { get; } internal Dictionary GroupsToMethods { get; } diff --git a/src/M31.FluentApi.Generator/CodeGeneration/CodeGenerator.cs b/src/M31.FluentApi.Generator/CodeGeneration/CodeGenerator.cs index 3a3544d..8f19e66 100644 --- a/src/M31.FluentApi.Generator/CodeGeneration/CodeGenerator.cs +++ b/src/M31.FluentApi.Generator/CodeGeneration/CodeGenerator.cs @@ -26,6 +26,7 @@ internal static CodeGeneratorResult GenerateCode(FluentApiClassInfo classInfo, C new ForkCreator(), new DuplicateMethodsChecker(), new InitialStepMethodGenerator(), + new FromExistingMethodGenerator(), new BuilderGenerator(), }; diff --git a/src/M31.FluentApi.Generator/M31.FluentApi.Generator.csproj b/src/M31.FluentApi.Generator/M31.FluentApi.Generator.csproj index 8076b62..19454a9 100644 --- a/src/M31.FluentApi.Generator/M31.FluentApi.Generator.csproj +++ b/src/M31.FluentApi.Generator/M31.FluentApi.Generator.csproj @@ -11,7 +11,7 @@ true true true - 2.0.0 + 2.1.0 Kevin Schaal The generator package for M31.FluentAPI. Don't install this package explicitly, install M31.FluentAPI instead. fluentapi fluentbuilder fluentinterface fluentdesign fluent codegeneration diff --git a/src/M31.FluentApi.Storybook/01_Basics.cs b/src/M31.FluentApi.Storybook/01_Basics.cs index 0e446e1..4077c11 100644 --- a/src/M31.FluentApi.Storybook/01_Basics.cs +++ b/src/M31.FluentApi.Storybook/01_Basics.cs @@ -8,8 +8,14 @@ namespace BasicExample { /* Generates a builder class with name CreateStudent and methods WithFirstName and WithLastName. The methods have to be called in the specified order, WithFirstName (builder step 0) has to be called before WithLastName (builder - step 1). As shown in the usage examples below, a student can be either created by calling the static - WithFirstName method on the CreateStudent class, or by first creating a new builder instance. + step 1). + As shown in the usage examples below, a student can be created by calling the static WithFirstName + method on the CreateStudent class. + Alternatively, an existing Student can be passed to the static FromExisting method. After calling FromExisting, + the builder can continue from any step. The FromExisting method mutates the passed instance, and the last name + is set to "Queen". + The InitialStep method can be used to create a builder instance without creating a student. This is useful for + advanced use cases such as the lambda pattern, as described in the README.md. Although I use classes with properties in all examples of this file, the FluentApi attribute can also be applied to structs and records, and the FluentMember attribute also works with fields. */ @@ -29,8 +35,10 @@ public static void UseTheGeneratedFluentApi() { Student student1 = CreateStudent.WithFirstName("Alice").WithLastName("King"); + Student student2 = CreateStudent.FromExisting(student1).WithLastName("Queen"); + CreateStudent.ICreateStudent createStudent = CreateStudent.InitialStep(); - Student student2 = createStudent.WithFirstName("Bob").WithLastName("Bishop"); + Student student3 = createStudent.WithFirstName("Bob").WithLastName("Bishop"); } } } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.expected.txt index 821be84..1980a1c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.AliasNamespace public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre { private readonly Student student; @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoseFriendsAre(System.Collections.Generic.IList friends) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre + { + } + public interface IWhoseFriendsAre { Student WhoseFriendsAre(System.Collections.Generic.IList friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.g.cs index 821be84..1980a1c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/AliasNamespaceClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.AliasNamespace public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre { private readonly Student student; @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoseFriendsAre(System.Collections.Generic.IList friends) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre + { + } + public interface IWhoseFriendsAre { Student WhoseFriendsAre(System.Collections.Generic.IList friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.expected.txt index 802436e..61471a2 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionInte public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.IList friends) { CreateStudent createStudent = new CreateStudent(); @@ -131,6 +142,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.IList friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.g.cs index 802436e..61471a2 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionInterfaceMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionInte public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.IList friends) { CreateStudent createStudent = new CreateStudent(); @@ -131,6 +142,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.IList friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.expected.txt index 3b60fb5..47d2d0b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionMemb public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.List friends) { CreateStudent createStudent = new CreateStudent(); @@ -125,6 +136,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.List friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.g.cs index 3b60fb5..47d2d0b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionMemb public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.List friends) { CreateStudent createStudent = new CreateStudent(); @@ -125,6 +136,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.List friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.expected.txt index abbf511..900dd31 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionMemb public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.List friends) { CreateStudent createStudent = new CreateStudent(); @@ -75,6 +86,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.List friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.g.cs index abbf511..900dd31 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionMemberClassWithSuppression/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionMemb public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.Generic.List friends) { CreateStudent createStudent = new CreateStudent(); @@ -75,6 +86,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.Generic.List friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.expected.txt index e57ff99..879e987 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionNull public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoseFriendsAre(params string[]? friends) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre + { + } + public interface IWhoseFriendsAre { Student WhoseFriendsAre(params string[]? friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.g.cs index e57ff99..879e987 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CollectionNullableArrayClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CollectionNull public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoseFriendsAre(params string[]? friends) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre + { + } + public interface IWhoseFriendsAre { Student WhoseFriendsAre(params string[]? friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.expected.txt index 5712ee7..47733a4 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithAf public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -58,6 +69,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithProperty1, IWithProperty2 + { + } + public interface IWithName { IWithProperty2 WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.g.cs index 5712ee7..47733a4 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithAfterCompoundClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithAf public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -58,6 +69,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithProperty1, IWithProperty2 + { + } + public interface IWithName { IWithProperty2 WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.expected.txt index bb8518e..28145f7 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithIn public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2AWithMember2B, CreateStudent.IWithMember3, @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2AWithMember2B WithMember1(string member1) { CreateStudent createStudent = new CreateStudent(); @@ -67,6 +78,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2AWithMember2B, IWithMember3, IWithMember4 + { + } + public interface IWithMember1 { IWithMember2AWithMember2B WithMember1(string member1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.g.cs index bb8518e..28145f7 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithInForkClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithIn public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2AWithMember2B, CreateStudent.IWithMember3, @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2AWithMember2B WithMember1(string member1) { CreateStudent createStudent = new CreateStudent(); @@ -67,6 +78,10 @@ public interface ICreateStudent : IWithMember1 { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2AWithMember2B, IWithMember3, IWithMember4 + { + } + public interface IWithMember1 { IWithMember2AWithMember2B WithMember1(string member1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.expected.txt index ea2b90d..56e75a8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithOf public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty1 Method1() { CreateStudent createStudent = new CreateStudent(); @@ -69,6 +80,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethod1Method1, IWithProperty1, IWithProperty2 + { + } + public interface IMethod1Method1 { IWithProperty1 Method1(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.g.cs index ea2b90d..56e75a8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithOfOverloadedMethodClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithOf public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty1 Method1() { CreateStudent createStudent = new CreateStudent(); @@ -69,6 +80,10 @@ public interface ICreateStudent : IMethod1Method1 { } + public interface ICreateStudentFromExisting : IMethod1Method1, IWithProperty1, IWithProperty2 + { + } + public interface IMethod1Method1 { IWithProperty1 Method1(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.expected.txt index 83119a9..4309fb2 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithSe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleNameWithLastName { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleNameWithLastName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleNameWithLastName + { + } + public interface IWithFirstName { IWithMiddleNameWithLastName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.g.cs index 83119a9..4309fb2 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ContinueWithSelfClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ContinueWithSe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleNameWithLastName { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleNameWithLastName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleNameWithLastName + { + } + public interface IWithFirstName { IWithMiddleNameWithLastName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.expected.txt index dc7c1b9..f1ac385 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CustomFluentMe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWhoIsHappy, CreateStudent.IInSemester, @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWhoIsHappy WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWhoIsHappy, IInSemester, IWhoseFriendsAre + { + } + public interface IWithName { IWhoIsHappy WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.g.cs index dc7c1b9..f1ac385 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/CustomFluentMethodNameClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.CustomFluentMe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWhoIsHappy, CreateStudent.IInSemester, @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWhoIsHappy WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWhoIsHappy, IInSemester, IWhoseFriendsAre + { + } + public interface IWithName { IWhoIsHappy WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.expected.txt index c6806b8..d2f8b1d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.DefaultFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IIsHappy, CreateStudent.IWithSemester, @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IIsHappy WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IIsHappy, IWithSemester, IWithFriends + { + } + public interface IWithName { IIsHappy WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.g.cs index c6806b8..d2f8b1d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/DefaultFluentMethodNameClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.DefaultFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IIsHappy, CreateStudent.IWithSemester, @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IIsHappy WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IIsHappy, IWithSemester, IWithFriends + { + } + public interface IWithName { IIsHappy WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.expected.txt index d5158d7..8957c75 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.expected.txt @@ -7,7 +7,9 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.EmptyClass; -public class CreateStudent : CreateStudent.ICreateStudent +public class CreateStudent : + CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting { private readonly Student student; @@ -16,12 +18,26 @@ public class CreateStudent : CreateStudent.ICreateStudent student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public interface ICreateStudent { } + + public interface ICreateStudentFromExisting + { + } } \ No newline at end of file diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.g.cs index d5158d7..8957c75 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/EmptyClass/CreateStudent.g.cs @@ -7,7 +7,9 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.EmptyClass; -public class CreateStudent : CreateStudent.ICreateStudent +public class CreateStudent : + CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting { private readonly Student student; @@ -16,12 +18,26 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public interface ICreateStudent { } + + public interface ICreateStudentFromExisting + { + } } \ No newline at end of file diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.expected.txt index a52bae8..750a887 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IStudies { @@ -19,11 +20,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IStudies + { + } + public interface IWithName { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.g.cs index a52bae8..750a887 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedCompoundClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IStudies { @@ -19,11 +20,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IStudies + { + } + public interface IWithName { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreatePhone.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreatePhone.g.cs index 49e1704..9ddfd2f 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreatePhone.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreatePhone.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreatePhone : CreatePhone.ICreatePhone, + CreatePhone.ICreatePhoneFromExisting, CreatePhone.IWithNumber, CreatePhone.IWithUsage { @@ -19,11 +20,21 @@ private CreatePhone() phone = new Phone(); } + private CreatePhone(Phone phone) + { + this.phone = phone; + } + public static ICreatePhone InitialStep() { return new CreatePhone(); } + public static ICreatePhoneFromExisting FromExisting(Phone phone) + { + return new CreatePhone(phone); + } + public static IWithUsage WithNumber(string number) { CreatePhone createPhone = new CreatePhone(); @@ -47,6 +58,10 @@ public interface ICreatePhone : IWithNumber { } + public interface ICreatePhoneFromExisting : IWithNumber, IWithUsage + { + } + public interface IWithNumber { IWithUsage WithNumber(string number); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.expected.txt index 0215330..25cc295 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.expected.txt @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithPhoneNumbers { @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPhoneNumbers WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithPhoneNumbers + { + } + public interface IWithName { IWithPhoneNumbers WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.g.cs index 0215330..25cc295 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedLambdaCollectionClass/CreateStudent.g.cs @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithPhoneNumbers { @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPhoneNumbers WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithPhoneNumbers + { + } + public interface IWithName { IWithPhoneNumbers WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.expected.txt index 5b9e9e9..2dd765e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAgeBornOn { @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's first and last name. /// The student's first name. /// The student's last name. @@ -61,6 +72,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IOfAgeBornOn + { + } + public interface IWithName { /// Sets the student's first and last name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.g.cs index 5b9e9e9..2dd765e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedMethodsClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAgeBornOn { @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's first and last name. /// The student's first name. /// The student's last name. @@ -61,6 +72,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IOfAgeBornOn + { + } + public interface IWithName { /// Sets the student's first and last name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.expected.txt index 40f765d..9e72169 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithGivenNameWithFirstName, CreateStudent.IWithLastName, CreateStudent.IOfAge, @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithGivenName(string givenName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithGivenNameWithFirstName, IWithLastName, IOfAge, IInSemester, ILivingIn + { + } + public interface IWithGivenNameWithFirstName { IWithLastName WithGivenName(string givenName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.g.cs index 40f765d..9e72169 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithGivenNameWithFirstName, CreateStudent.IWithLastName, CreateStudent.IOfAge, @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithGivenName(string givenName) { CreateStudent createStudent = new CreateStudent(); @@ -87,6 +98,10 @@ public interface ICreateStudent : IWithGivenNameWithFirstName { } + public interface ICreateStudentFromExisting : IWithGivenNameWithFirstName, IWithLastName, IOfAge, IInSemester, ILivingIn + { + } + public interface IWithGivenNameWithFirstName { IWithLastName WithGivenName(string givenName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.expected.txt index d1c54f6..e70691f 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAge, CreateStudent.ILivingIn, @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAge WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -90,6 +101,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IOfAge, ILivingIn, IWhoIsHappy + { + } + public interface IWithName { IOfAge WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.g.cs index d1c54f6..e70691f 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/CommentedPropertiesClassAdvanced/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAge, CreateStudent.ILivingIn, @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAge WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -90,6 +101,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IOfAge, ILivingIn, IWhoIsHappy + { + } + public interface IWithName { IOfAge WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.expected.txt index 1c8abe3..0892bba 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ILivingIn { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student LivingIn(string? city) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : ILivingIn + { + } + public interface ILivingIn { Student LivingIn(string? city); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.g.cs index 1c8abe3..0892bba 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/IncompletelyCommentedPropertyClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ILivingIn { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student LivingIn(string? city) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public interface ICreateStudent : ILivingIn { } + public interface ICreateStudentFromExisting : ILivingIn + { + } + public interface ILivingIn { Student LivingIn(string? city); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.expected.txt index a609f51..71ddfbf 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -49,6 +60,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.g.cs index a609f51..71ddfbf 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/RedundantCommentCompoundClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -49,6 +60,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.expected.txt index fe90a50..b74c341 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.g.cs index fe90a50..b74c341 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.expected.txt index d7e758b..32f8afe 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.g.cs index d7e758b..32f8afe 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentApiComments/WronglyCommentedClass2/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentApiComme public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.expected.txt index 9919ad8..be976a3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentDefaultM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -65,6 +76,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.g.cs index 9919ad8..be976a3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentDefaultMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentDefaultM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -65,6 +76,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateAddress.g.cs index 3939252..f195711 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCl public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.expected.txt index cd2bc47..1541daf 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.g.cs index cd2bc47..1541daf 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateAddress.g.cs index e81183e..4c7cc0e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace SomeOtherNamespace; public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.expected.txt index 432bf4b..b1f0b78 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.g.cs index 432bf4b..b1f0b78 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaClassInDifferentNamespace/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateAddress.g.cs index 27364f5..d4cbec4 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.expected.txt index d31ba5a..9c90196 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.expected.txt @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddresses { @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddresses WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -81,6 +92,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddresses + { + } + public interface IWithName { IWithAddresses WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.g.cs index d31ba5a..9c90196 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCollectionClass/CreateStudent.g.cs @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddresses { @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddresses WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -81,6 +92,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddresses + { + } + public interface IWithName { IWithAddresses WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateAddress.g.cs index 70908b4..ff7de95 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreatePhone.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreatePhone.g.cs index 56e0e5f..ecc286f 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreatePhone.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreatePhone.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreatePhone : CreatePhone.ICreatePhone, + CreatePhone.ICreatePhoneFromExisting, CreatePhone.IWithNumber, CreatePhone.IWithUsage { @@ -19,11 +20,21 @@ private CreatePhone() phone = new Phone(); } + private CreatePhone(Phone phone) + { + this.phone = phone; + } + public static ICreatePhone InitialStep() { return new CreatePhone(); } + public static ICreatePhoneFromExisting FromExisting(Phone phone) + { + return new CreatePhone(phone); + } + public static IWithUsage WithNumber(string number) { CreatePhone createPhone = new CreatePhone(); @@ -47,6 +58,10 @@ public interface ICreatePhone : IWithNumber { } + public interface ICreatePhoneFromExisting : IWithNumber, IWithUsage + { + } + public interface IWithNumber { IWithUsage WithNumber(string number); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.expected.txt index 55a5dae..b10b72b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithDetails { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithDetails WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithDetails + { + } + public interface IWithName { IWithDetails WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.g.cs index 55a5dae..b10b72b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithDetails { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithDetails WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithDetails + { + } + public interface IWithName { IWithDetails WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateAddress.g.cs index 018552b..b796184 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.expected.txt index 1fcde12..e8a27e5 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithDetails { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithDetails WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithDetails + { + } + public interface IWithName { IWithDetails WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.g.cs index 1fcde12..e8a27e5 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaCompoundOfSameTypeClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithDetails { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithDetails WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithDetails + { + } + public interface IWithName { IWithDetails WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateAddress.g.cs index a14f1e1..ed2c319 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.expected.txt index 65c2677..6d76076 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.expected.txt @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG { @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -273,6 +284,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG + { + } + public interface IWithName { IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.g.cs index 65c2677..6d76076 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyCollectionsClass/CreateStudent.g.cs @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG { @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -273,6 +284,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG + { + } + public interface IWithName { IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateAddress.g.cs index c9a50f8..970cecf 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.expected.txt index dab796b..c253eff 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.expected.txt @@ -14,6 +14,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG { @@ -24,11 +25,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -274,6 +285,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG + { + } + public interface IWithName { IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.g.cs index dab796b..c253eff 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaManyPrivateCollectionsClass/CreateStudent.g.cs @@ -14,6 +14,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaMa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG { @@ -24,11 +25,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -274,6 +285,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG + { + } + public interface IWithName { IWithAddressesAWithAddressesBWithAddressesCWithAddressesDWithAddressesEWithAddressesFWithAddressesG WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateAddress.g.cs index 62e7604..4d9355a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaNu public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.expected.txt index 91690f8..4cdc211 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaNu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -61,6 +72,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.g.cs index 91690f8..4cdc211 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaNullablePropertyClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaNu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithAddress { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithAddress WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -61,6 +72,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithAddress + { + } + public interface IWithName { IWithAddress WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.expected.txt index 113c8de..bc2c6b1 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaRe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithFriend { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithFriend WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -61,6 +72,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IWithFriend + { + } + public interface IWithName { IWithFriend WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.g.cs index 113c8de..bc2c6b1 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaRecursiveClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaRe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IWithFriend { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithFriend WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -61,6 +72,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IWithFriend + { + } + public interface IWithName { IWithFriend WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateAddress.g.cs index ba08ec2..ad37d6c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSi public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.expected.txt index 17e9faf..2f169eb 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithAddress { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithAddress(M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSingleStepClass.Address address) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithAddress + { + } + public interface IWithAddress { Student WithAddress(M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSingleStepClass.Address address); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.g.cs index 17e9faf..2f169eb 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentLambdaSingleStepClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithAddress { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithAddress(M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSingleStepClass.Address address) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithAddress { } + public interface ICreateStudentFromExisting : IWithAddress + { + } + public interface IWithAddress { Student WithAddress(M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentLambdaSingleStepClass.Address address); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.expected.txt index d6217e2..3ddebb0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.g.cs index d6217e2..3ddebb0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.expected.txt index a369db3..cb0b732 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodDe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName, CreateStudent.IBornOn, @@ -26,11 +27,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string firstName = "Alice") { CreateStudent createStudent = new CreateStudent(); @@ -84,6 +95,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName, IBornOn, IEnrolledIn, IInSemester, IWithNumberOfPassedExams, IWithNumberOfFailedExams + { + } + public interface IWithFirstName { IWithLastName WithFirstName(string firstName = "Alice"); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.g.cs index a369db3..cb0b732 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodDefaultValuesClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodDe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName, CreateStudent.IBornOn, @@ -26,11 +27,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string firstName = "Alice") { CreateStudent createStudent = new CreateStudent(); @@ -84,6 +95,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName, IBornOn, IEnrolledIn, IInSemester, IWithNumberOfPassedExams, IWithNumberOfFailedExams + { + } + public interface IWithFirstName { IWithLastName WithFirstName(string firstName = "Alice"); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.expected.txt index aaafeb2..106b81e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodPa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethodWithParams, CreateStudent.IMethodWithRefParameter, CreateStudent.IMethodWithInParameter, @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IMethodWithRefParameter MethodWithParams(params int[] numbers) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethodWithParams, IMethodWithRefParameter, IMethodWithInParameter, IMethodWithOutParameter, IMethodWithRefInAndOutParameter + { + } + public interface IMethodWithParams { IMethodWithRefParameter MethodWithParams(params int[] numbers); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.g.cs index aaafeb2..106b81e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentMethodParameterModifiersClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentMethodPa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethodWithParams, CreateStudent.IMethodWithRefParameter, CreateStudent.IMethodWithInParameter, @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IMethodWithRefParameter MethodWithParams(params int[] numbers) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public interface ICreateStudent : IMethodWithParams { } + public interface ICreateStudentFromExisting : IMethodWithParams, IMethodWithRefParameter, IMethodWithInParameter, IMethodWithOutParameter, IMethodWithRefInAndOutParameter + { + } + public interface IMethodWithParams { IMethodWithRefParameter MethodWithParams(params int[] numbers); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.expected.txt index fe01942..67219ed 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string? name) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string? name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.g.cs index fe01942..67219ed 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string? name) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string? name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.expected.txt index e667c08..8137434 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.g.cs index e667c08..8137434 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.expected.txt index c576631..a83920b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.g.cs index c576631..a83920b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentNullableNoNullableAnnotationPrivateSetClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentNullable public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.expected.txt index 1fd7cb2..d092ef4 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnMu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IWithName { IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.g.cs index 1fd7cb2..d092ef4 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnMu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IWithName { IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.expected.txt index 4052d76..9984272 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnMu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IWithName { IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.g.cs index 4052d76..9984272 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnMultiStepPrivateMethodsClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnMu public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -64,6 +75,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IWithName { IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.expected.txt index 6a4a255..fffc0dd 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static void ReturnVoidMethod() { CreateStudent createStudent = new CreateStudent(); @@ -73,6 +84,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { void ReturnVoidMethod(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.g.cs index 6a4a255..fffc0dd 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static void ReturnVoidMethod() { CreateStudent createStudent = new CreateStudent(); @@ -73,6 +84,10 @@ public interface ICreateStudent : IReturnVoidMethodReturnIntMethodReturnListMeth { } + public interface ICreateStudentFromExisting : IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { void ReturnVoidMethod(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.expected.txt index 4912474..ba68953 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { private readonly Student student; @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static void ReturnVoidMethod() { CreateStudent createStudent = new CreateStudent(); @@ -74,6 +85,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { void ReturnVoidMethod(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.g.cs index 4912474..ba68953 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FluentReturnSingleStepPrivateMethodsClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FluentReturnSi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { private readonly Student student; @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static void ReturnVoidMethod() { CreateStudent createStudent = new CreateStudent(); @@ -74,6 +85,10 @@ public interface ICreateStudent : IReturnVoidMethodReturnIntMethodReturnListMeth { } + public interface ICreateStudentFromExisting : IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter + { + } + public interface IReturnVoidMethodReturnIntMethodReturnListMethodReturnIntMethodWithRefParameter { void ReturnVoidMethod(); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.expected.txt index a360917..8a684d0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ForkClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IOfAgeBornOn { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student OfAge(int age) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IOfAgeBornOn + { + } + public interface IOfAgeBornOn { Student OfAge(int age); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.g.cs index a360917..8a684d0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ForkClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ForkClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IOfAgeBornOn { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student OfAge(int age) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IOfAgeBornOn { } + public interface ICreateStudentFromExisting : IOfAgeBornOn + { + } + public interface IOfAgeBornOn { Student OfAge(int age); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.expected.txt index 456fae4..b9a4c31 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FullyQualified public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IBornOnWithFriends { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student BornOn(System.DateOnly dateOfBirth) { CreateStudent createStudent = new CreateStudent(); @@ -94,6 +105,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IBornOnWithFriends + { + } + public interface IBornOnWithFriends { Student BornOn(System.DateOnly dateOfBirth); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.g.cs index 456fae4..b9a4c31 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/FullyQualifiedTypeClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.FullyQualified public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IBornOnWithFriends { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student BornOn(System.DateOnly dateOfBirth) { CreateStudent createStudent = new CreateStudent(); @@ -94,6 +105,10 @@ public interface ICreateStudent : IBornOnWithFriends { } + public interface ICreateStudentFromExisting : IBornOnWithFriends + { + } + public interface IBornOnWithFriends { Student BornOn(System.DateOnly dateOfBirth); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.expected.txt index e75241a..b474e7a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.g.cs index e75241a..b474e7a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public interface ICreateStudent : IWithProperty1WithProperty2 { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.expected.txt index 8435f14..6b85f66 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassPr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = CreateStudentInstance(default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.g.cs index 8435f14..6b85f66 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateConstructor/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassPr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = CreateStudentInstance(default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithProperty1WithProperty2 { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.expected.txt index 1c13124..2f72742 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassPr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = CreateStudentInstance(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.g.cs index 1c13124..2f72742 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassPrivateDefaultConstructor/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassPr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1WithProperty2 { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = CreateStudentInstance(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWithProperty1WithProperty2 { } + public interface ICreateStudentFromExisting : IWithProperty1WithProperty2 + { + } + public interface IWithProperty1WithProperty2 { Student WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.expected.txt index ab8f1f3..6317ff9 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -37,11 +38,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -107,6 +118,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IWithProperty6, IWithProperty7, IWithProperty8, IWithProperty9 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.g.cs index ab8f1f3..6317ff9 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithConstraints/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -37,11 +38,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -107,6 +118,10 @@ public interface ICreateStudent : IWithProperty1 { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IWithProperty6, IWithProperty7, IWithProperty8, IWithProperty9 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.expected.txt index e99d10d..43741dc 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -32,11 +33,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -101,6 +112,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IMethod1, IMethod2, IMethod3Method4 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.g.cs index e99d10d..43741dc 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithGenericMethods/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -32,11 +33,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -101,6 +112,10 @@ public interface ICreateStudent : IWithProperty1 { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IMethod1, IMethod2, IMethod3Method4 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.expected.txt index f9702a1..30e3865 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -33,11 +34,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -97,6 +108,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IMethod1, IMethod2, IMethod3 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.g.cs index f9702a1..30e3865 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericClassWithPrivateGenericMethods/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericClassWi public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2, CreateStudent.IWithProperty3, @@ -33,11 +34,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(T1 property1) { CreateStudent createStudent = new CreateStudent(); @@ -97,6 +108,10 @@ public interface ICreateStudent : IWithProperty1 { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2, IWithProperty3, IWithProperty4, IWithProperty5, IMethod1, IMethod2, IMethod3 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(T1 property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.expected.txt index 031cf81..6ce40c3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericMethodW public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1 { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) where T1 : class where T2 : class? @@ -51,6 +62,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethod1 + { + } + public interface IMethod1 { Student Method1(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.g.cs index 031cf81..6ce40c3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericMethodWithConstraintsClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericMethodW public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1 { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) where T1 : class where T2 : class? @@ -51,6 +62,10 @@ public interface ICreateStudent : IMethod1 { } + public interface ICreateStudentFromExisting : IMethod1 + { + } + public interface IMethod1 { Student Method1(T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.expected.txt index 992c34d..0f83ca6 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericOverloa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1Method1Method1Method1Method1Method1 { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(int p1, string p2) { CreateStudent createStudent = new CreateStudent(); @@ -120,6 +131,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethod1Method1Method1Method1Method1Method1Method1 + { + } + public interface IMethod1Method1Method1Method1Method1Method1Method1 { Student Method1(int p1, string p2); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.g.cs index 992c34d..0f83ca6 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedMethodClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericOverloa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1Method1Method1Method1Method1Method1 { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(int p1, string p2) { CreateStudent createStudent = new CreateStudent(); @@ -120,6 +131,10 @@ public interface ICreateStudent : IMethod1Method1Method1Method1Method1Method1Met { } + public interface ICreateStudentFromExisting : IMethod1Method1Method1Method1Method1Method1Method1 + { + } + public interface IMethod1Method1Method1Method1Method1Method1Method1 { Student Method1(int p1, string p2); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.expected.txt index cfba9f6..074ee4a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericOverloa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1Method1Method1Method1Method1Method1 { private readonly Student student; @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(int p1, string p2) { CreateStudent createStudent = new CreateStudent(); @@ -121,6 +132,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethod1Method1Method1Method1Method1Method1Method1 + { + } + public interface IMethod1Method1Method1Method1Method1Method1Method1 { Student Method1(int p1, string p2); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.g.cs index cfba9f6..074ee4a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GenericOverloadedPrivateMethodClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GenericOverloa public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethod1Method1Method1Method1Method1Method1Method1 { private readonly Student student; @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Method1(int p1, string p2) { CreateStudent createStudent = new CreateStudent(); @@ -121,6 +132,10 @@ public interface ICreateStudent : IMethod1Method1Method1Method1Method1Method1Met { } + public interface ICreateStudentFromExisting : IMethod1Method1Method1Method1Method1Method1Method1 + { + } + public interface IMethod1Method1Method1Method1Method1Method1Method1 { Student Method1(int p1, string p2); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.expected.txt index c7f94ba..9e96ab6 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetInitPropert public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.g.cs index c7f94ba..9e96ab6 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetInitPropertyClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetInitPropert public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.expected.txt index 7d7820a..e5ee1a3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetPrivateInit public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.g.cs index 7d7820a..e5ee1a3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateInitPropertyClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetPrivateInit public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.expected.txt index 5974eb5..43fef48 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetPrivateSetP public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.g.cs index 5974eb5..43fef48 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/GetPrivateSetPropertyClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.GetPrivateSetP public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreatePerson.g.cs index f0d1a88..7a81295 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreatePerson.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithName, CreatePerson.IBornOn { @@ -21,11 +22,21 @@ private CreatePerson() person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IBornOn WithName(string name) { CreatePerson createPerson = new CreatePerson(); @@ -49,6 +60,10 @@ public interface ICreatePerson : IWithName { } + public interface ICreatePersonFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.expected.txt index 7c77f8e..74d5c06 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.g.cs index 7c77f8e..74d5c06 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreatePerson.g.cs index 3e4d042..4f22c8a 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreatePerson.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithName, CreatePerson.IOfAgeBornOn { @@ -22,11 +23,21 @@ private CreatePerson() person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IOfAgeBornOn WithName(string name) { CreatePerson createPerson = new CreatePerson(); @@ -56,6 +67,10 @@ public interface ICreatePerson : IWithName { } + public interface ICreatePersonFromExisting : IWithName, IOfAgeBornOn + { + } + public interface IWithName { IOfAgeBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.expected.txt index 119b64a..d03732b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAgeBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAgeBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -63,6 +74,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IOfAgeBornOn, IInSemester + { + } + public interface IWithName { IOfAgeBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.g.cs index 119b64a..d03732b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassPrivateSetters/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IOfAgeBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAgeBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -63,6 +74,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IOfAgeBornOn, IInSemester + { + } + public interface IWithName { IOfAgeBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreatePerson.g.cs index 01716ab..92316a0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreatePerson.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithName, CreatePerson.IBornOn { @@ -22,11 +23,21 @@ private CreatePerson() person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IBornOn WithName(string name) { CreatePerson createPerson = new CreatePerson(); @@ -50,6 +61,10 @@ public interface ICreatePerson : IWithName { } + public interface ICreatePersonFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.expected.txt index 1054b46..e37e6bc 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.g.cs index 1054b46..e37e6bc 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedMembers/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreatePerson.g.cs index 365059a..43db7d9 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreatePerson.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithName, CreatePerson.IBornOn { @@ -22,11 +23,21 @@ private CreatePerson() person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IBornOn WithName(string name) { CreatePerson createPerson = new CreatePerson(); @@ -50,6 +61,10 @@ public interface ICreatePerson : IWithName { } + public interface ICreatePersonFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.expected.txt index 5f84e0f..53d54e3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.g.cs index 5f84e0f..53d54e3 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedClassProtectedSetters/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreatePerson.g.cs index 2f70e75..185931c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreatePerson.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedRecor public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithName, CreatePerson.IBornOn { @@ -22,11 +23,21 @@ private CreatePerson() person = new Person(default!, default!); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IBornOn WithName(string name) { CreatePerson createPerson = new CreatePerson(); @@ -50,6 +61,10 @@ public interface ICreatePerson : IWithName { } + public interface ICreatePersonFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.expected.txt index 26df6f0..e918e55 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedRecor public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(default!, default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.g.cs index 26df6f0..e918e55 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InheritedRecord/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InheritedRecor public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(default!, default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.expected.txt index 2b81e3a..9488ff1 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InternalClass; internal class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ internal class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + internal static ICreateStudent InitialStep() { return new CreateStudent(); } + internal static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ internal class CreateStudent : { } + internal interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + internal interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.g.cs index 2b81e3a..9488ff1 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InternalClass; internal class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + internal static ICreateStudent InitialStep() { return new CreateStudent(); } + internal static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ internal interface ICreateStudent : IWithName { } + internal interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + internal interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.expected.txt index d1be796..234876d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InternalProper public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.g.cs index d1be796..234876d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/InternalPropertyClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.InternalProper public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.expected.txt index ebe6abf..6a056bb 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.KeywordClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithOperator, CreateStudent.IWithClass, CreateStudent.IWithVoid @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithClass WithOperator(string @operator) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithOperator, IWithClass, IWithVoid + { + } + public interface IWithOperator { IWithClass WithOperator(string @operator); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.g.cs index ebe6abf..6a056bb 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/KeywordClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.KeywordClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithOperator, CreateStudent.IWithClass, CreateStudent.IWithVoid @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithClass WithOperator(string @operator) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithOperator { } + public interface ICreateStudentFromExisting : IWithOperator, IWithClass, IWithVoid + { + } + public interface IWithOperator { IWithClass WithOperator(string @operator); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.expected.txt index 0ca931f..cc07189 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.NonGenericColl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.IEnumerable friends) { CreateStudent createStudent = new CreateStudent(); @@ -132,6 +143,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.IEnumerable friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.g.cs index 0ca931f..cc07189 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NonGenericCollectionMemberClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.NonGenericColl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWithPets, CreateStudent.IWithBackpackContent @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithPets WhoseFriendsAre(System.Collections.IEnumerable friends) { CreateStudent createStudent = new CreateStudent(); @@ -132,6 +143,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWithPets, IWithBackpackContent + { + } + public interface IWhoseFriendsAre { IWithPets WhoseFriendsAre(System.Collections.IEnumerable friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.expected.txt index fc3568a..da940de 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.NullablePredic public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWhoIsHappy { @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWhoIsHappy WhoseFriendsAre(System.Collections.Generic.IReadOnlyCollection? friends) { CreateStudent createStudent = new CreateStudent(); @@ -114,6 +125,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWhoIsHappy + { + } + public interface IWhoseFriendsAre { IWhoIsHappy WhoseFriendsAre(System.Collections.Generic.IReadOnlyCollection? friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.g.cs index fc3568a..da940de 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/NullablePredicateAndCollectionClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.NullablePredic public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoseFriendsAre, CreateStudent.IWhoIsHappy { @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWhoIsHappy WhoseFriendsAre(System.Collections.Generic.IReadOnlyCollection? friends) { CreateStudent createStudent = new CreateStudent(); @@ -114,6 +125,10 @@ public interface ICreateStudent : IWhoseFriendsAre { } + public interface ICreateStudentFromExisting : IWhoseFriendsAre, IWhoIsHappy + { + } + public interface IWhoseFriendsAre { IWhoIsHappy WhoseFriendsAre(System.Collections.Generic.IReadOnlyCollection? friends); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.expected.txt index 0778048..02f3207 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.OneMemberClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.g.cs index 0778048..02f3207 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OneMemberClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.OneMemberClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.expected.txt index dc271c9..11fdb92 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.OverloadedMeth public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.INamedNamed { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Named(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : INamedNamed + { + } + public interface INamedNamed { Student Named(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.g.cs index dc271c9..11fdb92 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/OverloadedMethodClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.OverloadedMeth public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.INamedNamed { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student Named(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : INamedNamed { } + public interface ICreateStudentFromExisting : INamedNamed + { + } + public interface INamedNamed { Student Named(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.expected.txt index c29e16d..90aeb76 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ParameterAnnot public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 { @@ -23,11 +24,21 @@ public class CreateStudent : student = CreateStudentInstance(ref v, in v2, out _); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(string property1) { CreateStudent createStudent = new CreateStudent(); @@ -51,6 +62,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(string property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.g.cs index c29e16d..90aeb76 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPrivateConstructorClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ParameterAnnot public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 { @@ -23,11 +24,21 @@ private CreateStudent() student = CreateStudentInstance(ref v, in v2, out _); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(string property1) { CreateStudent createStudent = new CreateStudent(); @@ -51,6 +62,10 @@ public interface ICreateStudent : IWithProperty1 { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(string property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.expected.txt index d0ddf81..2d642f0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ParameterAnnot public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(ref v, in v2, out _); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(string property1) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(string property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.g.cs index d0ddf81..2d642f0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ParameterAnnotationsPublicConstructorClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ParameterAnnot public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithProperty1, CreateStudent.IWithProperty2 { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(ref v, in v2, out _); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithProperty2 WithProperty1(string property1) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public interface ICreateStudent : IWithProperty1 { } + public interface ICreateStudentFromExisting : IWithProperty1, IWithProperty2 + { + } + public interface IWithProperty1 { IWithProperty2 WithProperty1(string property1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.expected.txt index 4b6bcd0..887a6e5 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PartialClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName + { + } + public interface IWithFirstName { IWithLastName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.g.cs index 4b6bcd0..887a6e5 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PartialClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PartialClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName + { + } + public interface IWithFirstName { IWithLastName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.expected.txt index 8fc6dfa..923dc8d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PredicateClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoIsHappy { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoIsHappy(bool isHappy = true) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoIsHappy + { + } + public interface IWhoIsHappy { Student WhoIsHappy(bool isHappy = true); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.g.cs index 8fc6dfa..923dc8d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicateClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PredicateClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoIsHappy { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoIsHappy(bool isHappy = true) { CreateStudent createStudent = new CreateStudent(); @@ -53,6 +64,10 @@ public interface ICreateStudent : IWhoIsHappy { } + public interface ICreateStudentFromExisting : IWhoIsHappy + { + } + public interface IWhoIsHappy { Student WhoIsHappy(bool isHappy = true); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.expected.txt index d3ec4f9..8e72e87 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PredicatePriva public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoIsHappy { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoIsHappy(bool isHappy = true) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWhoIsHappy + { + } + public interface IWhoIsHappy { Student WhoIsHappy(bool isHappy = true); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.g.cs index d3ec4f9..8e72e87 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PredicatePrivateFieldClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PredicatePriva public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWhoIsHappy { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WhoIsHappy(bool isHappy = true) { CreateStudent createStudent = new CreateStudent(); @@ -55,6 +66,10 @@ public interface ICreateStudent : IWhoIsHappy { } + public interface ICreateStudentFromExisting : IWhoIsHappy + { + } + public interface IWhoIsHappy { Student WhoIsHappy(bool isHappy = true); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.expected.txt index b6d9589..79f773d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateConstru public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = CreateStudentInstance(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.g.cs index b6d9589..79f773d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateConstru public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = CreateStudentInstance(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.expected.txt index b7fe4ee..1b87809 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateConstru public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = CreateStudentInstance(default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.g.cs index b7fe4ee..1b87809 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateConstructorClassWithParams/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateConstru public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = CreateStudentInstance(default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.expected.txt index 33885b8..3f62d08 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFieldCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.g.cs index 33885b8..3f62d08 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFieldClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFieldCl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.expected.txt index 52a82c3..6067e35 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.g.cs index 52a82c3..6067e35 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.expected.txt index e4d8371..023503e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string? name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string? name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.g.cs index e4d8371..023503e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodNullableParameterClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string? name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string? name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.expected.txt index a2fa340..0c1108b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethodWithParams, CreateStudent.IMethodWithRefParameter, CreateStudent.IMethodWithInParameter, @@ -24,11 +25,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IMethodWithRefParameter MethodWithParams(params int[] numbers) { CreateStudent createStudent = new CreateStudent(); @@ -70,6 +81,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IMethodWithParams, IMethodWithRefParameter, IMethodWithInParameter, IMethodWithOutParameter, IMethodWithRefInAndOutParameter + { + } + public interface IMethodWithParams { IMethodWithRefParameter MethodWithParams(params int[] numbers); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.g.cs index a2fa340..0c1108b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateFluentMethodParameterModifiersClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateFluentM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IMethodWithParams, CreateStudent.IMethodWithRefParameter, CreateStudent.IMethodWithInParameter, @@ -24,11 +25,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IMethodWithRefParameter MethodWithParams(params int[] numbers) { CreateStudent createStudent = new CreateStudent(); @@ -70,6 +81,10 @@ public interface ICreateStudent : IMethodWithParams { } + public interface ICreateStudentFromExisting : IMethodWithParams, IMethodWithRefParameter, IMethodWithInParameter, IMethodWithOutParameter, IMethodWithRefInAndOutParameter + { + } + public interface IMethodWithParams { IMethodWithRefParameter MethodWithParams(params int[] numbers); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.expected.txt index b8347b2..620390c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateReadonl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.g.cs index b8347b2..620390c 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateReadonlyFieldClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateReadonl public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.expected.txt index d7a0e0c..474ede8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateUndersc public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.g.cs index d7a0e0c..474ede8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PrivateUnderscoreFieldClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PrivateUndersc public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.expected.txt index 61950fb..613e772 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PublicFieldCla public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.g.cs index 61950fb..613e772 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicFieldClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PublicFieldCla public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -40,6 +51,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.expected.txt index a66afb9..7fc654e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PublicReadonly public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.g.cs index a66afb9..7fc654e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/PublicReadonlyFieldClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.PublicReadonly public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester + { + } + public interface IInSemester { Student InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.expected.txt index a0e19e4..4f05053 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SameNameMember public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester, CreateStudent.IWithName, CreateStudent.IWithName2 @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithName InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IInSemester, IWithName, IWithName2 + { + } + public interface IInSemester { IWithName InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.g.cs index a0e19e4..4f05053 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SameNameMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SameNameMember public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IInSemester, CreateStudent.IWithName, CreateStudent.IWithName2 @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithName InSemester(int semester) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IInSemester { } + public interface ICreateStudentFromExisting : IInSemester, IWithName, IWithName2 + { + } + public interface IInSemester { IWithName InSemester(int semester); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.expected.txt index 54aa98a..ea2c270 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableFirst public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName { @@ -19,11 +20,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string? firstName) { CreateStudent createStudent = new CreateStudent(); @@ -54,6 +65,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName + { + } + public interface IWithFirstName : IWithLastName { IWithLastName WithFirstName(string? firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.g.cs index 54aa98a..ea2c270 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstMemberClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableFirst public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithLastName { @@ -19,11 +20,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithLastName WithFirstName(string? firstName) { CreateStudent createStudent = new CreateStudent(); @@ -54,6 +65,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithLastName + { + } + public interface IWithFirstName : IWithLastName { IWithLastName WithFirstName(string? firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.expected.txt index 55b8e9f..98d1a9b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableFirst public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleName, CreateStudent.IWithLastName @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleName WithFirstName(string? firstName) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleName, IWithLastName + { + } + public interface IWithFirstName : IWithMiddleName { IWithMiddleName WithFirstName(string? firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.g.cs index 55b8e9f..98d1a9b 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableFirstTwoMembersClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableFirst public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleName, CreateStudent.IWithLastName @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleName WithFirstName(string? firstName) { CreateStudent createStudent = new CreateStudent(); @@ -68,6 +79,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleName, IWithLastName + { + } + public interface IWithFirstName : IWithMiddleName { IWithMiddleName WithFirstName(string? firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.expected.txt index 7172471..7d9ecfe 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableForkM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember0, CreateStudent.IWithMember1AWithMember1B, CreateStudent.IWithMember0WithMember1AWithMember1B, @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember1AWithMember1B WithMember0(string? member0) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithMember0, IWithMember1AWithMember1B, IWithMember0WithMember1AWithMember1B, IWithMember2 + { + } + public interface IWithMember0 : IWithMember0WithMember1AWithMember1B { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.g.cs index 7172471..7d9ecfe 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableForkMembersClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableForkM public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember0, CreateStudent.IWithMember1AWithMember1B, CreateStudent.IWithMember0WithMember1AWithMember1B, @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember1AWithMember1B WithMember0(string? member0) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public interface ICreateStudent : IWithMember0 { } + public interface ICreateStudentFromExisting : IWithMember0, IWithMember1AWithMember1B, IWithMember0WithMember1AWithMember1B, IWithMember2 + { + } + public interface IWithMember0 : IWithMember0WithMember1AWithMember1B { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.expected.txt index 5b6fb06..e7f76d0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableLoopC public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2, CreateStudent.IWithMember3WithMember4, @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2 WithMember1(string? member1) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2, IWithMember3WithMember4, IWithMember1WithMember2WithMember3WithMember4 + { + } + public interface IWithMember1 : IWithMember1WithMember2WithMember3WithMember4 { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.g.cs index 5b6fb06..e7f76d0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableLoopClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableLoopC public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2, CreateStudent.IWithMember3WithMember4, @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2 WithMember1(string? member1) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public interface ICreateStudent : IWithMember1 { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2, IWithMember3WithMember4, IWithMember1WithMember2WithMember3WithMember4 + { + } + public interface IWithMember1 : IWithMember1WithMember2WithMember3WithMember4 { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.expected.txt index ace9ae9..4a95af7 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableMembe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleName, CreateStudent.IWithLastName @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -54,6 +65,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleName, IWithLastName + { + } + public interface IWithFirstName { IWithMiddleName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.g.cs index ace9ae9..4a95af7 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableMemberClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableMembe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithFirstName, CreateStudent.IWithMiddleName, CreateStudent.IWithLastName @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMiddleName WithFirstName(string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -54,6 +65,10 @@ public interface ICreateStudent : IWithFirstName { } + public interface ICreateStudentFromExisting : IWithFirstName, IWithMiddleName, IWithLastName + { + } + public interface IWithFirstName { IWithMiddleName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.expected.txt index f500f6f..12b0008 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableSever public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2, CreateStudent.IWithMember3, @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2 WithMember1(string? member1) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2, IWithMember3, IWithMember4 + { + } + public interface IWithMember1 : IWithMember2 { IWithMember2 WithMember1(string? member1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.g.cs index f500f6f..12b0008 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableSeveralMembersClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableSever public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember1, CreateStudent.IWithMember2, CreateStudent.IWithMember3, @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember2 WithMember1(string? member1) { CreateStudent createStudent = new CreateStudent(); @@ -82,6 +93,10 @@ public interface ICreateStudent : IWithMember1 { } + public interface ICreateStudentFromExisting : IWithMember1, IWithMember2, IWithMember3, IWithMember4 + { + } + public interface IWithMember1 : IWithMember2 { IWithMember2 WithMember1(string? member1); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.expected.txt index 87b5177..b64b0a8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableTwoLo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember0, CreateStudent.IWithMember1WithMember1B, CreateStudent.IWithMember0WithMember1WithMember1B, @@ -25,11 +26,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember1WithMember1B WithMember0(string? member0) { CreateStudent createStudent = new CreateStudent(); @@ -103,6 +114,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithMember0, IWithMember1WithMember1B, IWithMember0WithMember1WithMember1B, IWithMember2, IWithMember3, IWithMember4WithMember4B, IWithMember3WithMember4WithMember4B, IWithMember5 + { + } + public interface IWithMember0 : IWithMember0WithMember1WithMember1B { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.g.cs index 87b5177..b64b0a8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/SkippableTwoLoopsClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.SkippableTwoLo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithMember0, CreateStudent.IWithMember1WithMember1B, CreateStudent.IWithMember0WithMember1WithMember1B, @@ -25,11 +26,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IWithMember1WithMember1B WithMember0(string? member0) { CreateStudent createStudent = new CreateStudent(); @@ -103,6 +114,10 @@ public interface ICreateStudent : IWithMember0 { } + public interface ICreateStudentFromExisting : IWithMember0, IWithMember1WithMember1B, IWithMember0WithMember1WithMember1B, IWithMember2, IWithMember3, IWithMember4WithMember4B, IWithMember3WithMember4WithMember4B, IWithMember5 + { + } + public interface IWithMember0 : IWithMember0WithMember1WithMember1B { } diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.expected.txt index 003aa94..26f7230 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberCla public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.g.cs index 003aa94..26f7230 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberCla public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/UsageTests.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/UsageTests.cs index 8904ce7..08a6dd6 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/UsageTests.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberClass/UsageTests.cs @@ -22,6 +22,23 @@ public void CanExecuteThreeMemberClass() Assert.Equal(new DateOnly(2002, 8, 3), student.DateOfBirth); Assert.Equal(2, student.Semester); } + + [Fact, Priority(1)] + public void CanCreateThreeMemberClassFromExisting() + { + Student student = CreateStudent + .WithName("Alice") + .BornOn(new DateOnly(2002, 8, 3)) + .InSemester(2); + + Student newStudent = CreateStudent.FromExisting(student) + .BornOn(new DateOnly(2003, 4, 4)) + .InSemester(1); + + Assert.Equal("Alice", newStudent.Name); + Assert.Equal(new DateOnly(2003, 4, 4), newStudent.DateOfBirth); + Assert.Equal(1, newStudent.Semester); + } } #endif \ No newline at end of file diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.expected.txt index 8d48db4..140413d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.g.cs index 8d48db4..140413d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecord/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.expected.txt index 6548edb..3e15981 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(default!, default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.g.cs index 6548edb..3e15981 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordPrimaryConstructor/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(default!, default!, default!); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.expected.txt index 87b9e49..639d237 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.g.cs index 87b9e49..639d237 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberRecordStruct/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberRec public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.expected.txt index 5a56440..76578dd 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberStr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.g.cs index 5a56440..76578dd 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreeMemberStruct/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreeMemberStr public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -22,11 +23,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -56,6 +67,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.expected.txt index 86f1d22..f85f412 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.expected.txt @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreePrivateMe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.g.cs index 86f1d22..f85f412 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/ThreePrivateMembersClass/CreateStudent.g.cs @@ -12,6 +12,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.ThreePrivateMe public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn, CreateStudent.IInSemester @@ -23,11 +24,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -57,6 +68,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn, IInSemester + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.expected.txt index be58272..04ad192 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ISomeMethod { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student SomeMethod(string someMethodMethodInfo) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : ISomeMethod + { + } + public interface ISomeMethod { Student SomeMethod(string someMethodMethodInfo); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.g.cs index be58272..04ad192 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass1/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ISomeMethod { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student SomeMethod(string someMethodMethodInfo) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : ISomeMethod { } + public interface ICreateStudentFromExisting : ISomeMethod + { + } + public interface ISomeMethod { Student SomeMethod(string someMethodMethodInfo); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.expected.txt index 7a55d65..907ab91 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ISomeMethod { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student SomeMethod(string createStudent) { CreateStudent createStudent2 = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : ISomeMethod + { + } + public interface ISomeMethod { Student SomeMethod(string createStudent); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.g.cs index 7a55d65..907ab91 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass2/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.ISomeMethod { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student SomeMethod(string createStudent) { CreateStudent createStudent2 = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : ISomeMethod { } + public interface ICreateStudentFromExisting : ISomeMethod + { + } + public interface ISomeMethod { Student SomeMethod(string createStudent); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateAddress.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateAddress.g.cs index f89403d..0b039ea 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateAddress.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateAddress.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateAddress : CreateAddress.ICreateAddress, + CreateAddress.ICreateAddressFromExisting, CreateAddress.IWithHouseNumber, CreateAddress.IWithStreet, CreateAddress.IInCity @@ -20,11 +21,21 @@ private CreateAddress() address = new Address(); } + private CreateAddress(Address address) + { + this.address = address; + } + public static ICreateAddress InitialStep() { return new CreateAddress(); } + public static ICreateAddressFromExisting FromExisting(Address address) + { + return new CreateAddress(address); + } + public static IWithStreet WithHouseNumber(string houseNumber) { CreateAddress createAddress = new CreateAddress(); @@ -54,6 +65,10 @@ public interface ICreateAddress : IWithHouseNumber { } + public interface ICreateAddressFromExisting : IWithHouseNumber, IWithStreet, IInCity + { + } + public interface IWithHouseNumber { IWithStreet WithHouseNumber(string houseNumber); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.expected.txt index 5fc9e10..552f3b0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithDetails { private readonly Student student; @@ -20,11 +21,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithDetails(string createAddress, M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluentApiClass3.Address address) { CreateStudent createStudent = new CreateStudent(); @@ -59,6 +70,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithDetails + { + } + public interface IWithDetails { Student WithDetails(string createAddress, M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluentApiClass3.Address address); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.g.cs index 5fc9e10..552f3b0 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TryBreakFluentApiClass3/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluent public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithDetails { private readonly Student student; @@ -20,11 +21,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithDetails(string createAddress, M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluentApiClass3.Address address) { CreateStudent createStudent = new CreateStudent(); @@ -59,6 +70,10 @@ public interface ICreateStudent : IWithDetails { } + public interface ICreateStudentFromExisting : IWithDetails + { + } + public interface IWithDetails { Student WithDetails(string createAddress, M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TryBreakFluentApiClass3.Address address); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.expected.txt index 6c11a95..907e321 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoMemberClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.g.cs index 6c11a95..907e321 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoMemberClass/CreateStudent.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoMemberClass public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName, CreateStudent.IBornOn { @@ -21,11 +22,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IBornOn WithName(string name) { CreateStudent createStudent = new CreateStudent(); @@ -49,6 +60,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName, IBornOn + { + } + public interface IWithName { IBornOn WithName(string name); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.expected.txt index e405afd..ae14f27 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoParameterCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.g.cs index e405afd..ae14f27 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClass/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoParameterCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.expected.txt index 7b8f60a..6aa6e21 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.expected.txt @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoParameterCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string lastName, string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string lastName, string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.g.cs index 7b8f60a..6aa6e21 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/Abstract/TwoParameterCompoundClassReversedParameters/CreateStudent.g.cs @@ -9,6 +9,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.Abstract.TwoParameterCo public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.IWithName { private readonly Student student; @@ -18,11 +19,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static Student WithName(string lastName, string firstName) { CreateStudent createStudent = new CreateStudent(); @@ -42,6 +53,10 @@ public interface ICreateStudent : IWithName { } + public interface ICreateStudentFromExisting : IWithName + { + } + public interface IWithName { Student WithName(string lastName, string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.expected.txt index 533862f..af5ae0e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.expected.txt @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.DocumentedStudentClass; public class CreateDocumentedStudent : CreateDocumentedStudent.ICreateDocumentedStudent, + CreateDocumentedStudent.ICreateDocumentedStudentFromExisting, CreateDocumentedStudent.INamed, CreateDocumentedStudent.IOfAgeBornOn, CreateDocumentedStudent.IInSemester, @@ -27,11 +28,21 @@ public class CreateDocumentedStudent : documentedStudent = new DocumentedStudent(); } + private CreateDocumentedStudent(DocumentedStudent documentedStudent) + { + this.documentedStudent = documentedStudent; + } + public static ICreateDocumentedStudent InitialStep() { return new CreateDocumentedStudent(); } + public static ICreateDocumentedStudentFromExisting FromExisting(DocumentedStudent documentedStudent) + { + return new CreateDocumentedStudent(documentedStudent); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -152,6 +163,10 @@ public class CreateDocumentedStudent : { } + public interface ICreateDocumentedStudentFromExisting : INamed, IOfAgeBornOn, IInSemester, ILivingIn, IWhoIsHappy, IWhoseFriendsAre + { + } + public interface INamed { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.g.cs index 533862f..af5ae0e 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/DocumentedStudentClass/CreateDocumentedStudent.g.cs @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.DocumentedStudentClass; public class CreateDocumentedStudent : CreateDocumentedStudent.ICreateDocumentedStudent, + CreateDocumentedStudent.ICreateDocumentedStudentFromExisting, CreateDocumentedStudent.INamed, CreateDocumentedStudent.IOfAgeBornOn, CreateDocumentedStudent.IInSemester, @@ -27,11 +28,21 @@ private CreateDocumentedStudent() documentedStudent = new DocumentedStudent(); } + private CreateDocumentedStudent(DocumentedStudent documentedStudent) + { + this.documentedStudent = documentedStudent; + } + public static ICreateDocumentedStudent InitialStep() { return new CreateDocumentedStudent(); } + public static ICreateDocumentedStudentFromExisting FromExisting(DocumentedStudent documentedStudent) + { + return new CreateDocumentedStudent(documentedStudent); + } + /// Sets the student's name. /// The student's first name. /// The student's last name. @@ -152,6 +163,10 @@ public interface ICreateDocumentedStudent : INamed { } + public interface ICreateDocumentedStudentFromExisting : INamed, IOfAgeBornOn, IInSemester, ILivingIn, IWhoIsHappy, IWhoseFriendsAre + { + } + public interface INamed { /// Sets the student's name. diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.expected.txt index 9262828..2b14cc8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.expected.txt @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.PersonClass; public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithFirstName, CreatePerson.IWithMiddleName, CreatePerson.IWithLastName, @@ -27,11 +28,21 @@ public class CreatePerson : person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IWithMiddleName WithFirstName(string firstName) { CreatePerson createPerson = new CreatePerson(); @@ -103,6 +114,10 @@ public class CreatePerson : { } + public interface ICreatePersonFromExisting : IWithFirstName, IWithMiddleName, IWithLastName, IWhoseAddressIsUnknownWhoLivesAtAddressWhoIsADigitalNomad, IWithHouseNumber, IWithStreet, IInCity, ILivingInCity + { + } + public interface IWithFirstName { IWithMiddleName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.g.cs index 9262828..2b14cc8 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/PersonClass/CreatePerson.g.cs @@ -11,6 +11,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.PersonClass; public class CreatePerson : CreatePerson.ICreatePerson, + CreatePerson.ICreatePersonFromExisting, CreatePerson.IWithFirstName, CreatePerson.IWithMiddleName, CreatePerson.IWithLastName, @@ -27,11 +28,21 @@ private CreatePerson() person = new Person(); } + private CreatePerson(Person person) + { + this.person = person; + } + public static ICreatePerson InitialStep() { return new CreatePerson(); } + public static ICreatePersonFromExisting FromExisting(Person person) + { + return new CreatePerson(person); + } + public static IWithMiddleName WithFirstName(string firstName) { CreatePerson createPerson = new CreatePerson(); @@ -103,6 +114,10 @@ public interface ICreatePerson : IWithFirstName { } + public interface ICreatePersonFromExisting : IWithFirstName, IWithMiddleName, IWithLastName, IWhoseAddressIsUnknownWhoLivesAtAddressWhoIsADigitalNomad, IWithHouseNumber, IWithStreet, IInCity, ILivingInCity + { + } + public interface IWithFirstName { IWithMiddleName WithFirstName(string firstName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.expected.txt b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.expected.txt index 8cc576a..e0dce4d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.expected.txt +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.expected.txt @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.StudentClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.INamed, CreateStudent.IOfAgeBornOn, CreateStudent.IInSemester, @@ -27,11 +28,21 @@ public class CreateStudent : student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAgeBornOn Named(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -133,6 +144,10 @@ public class CreateStudent : { } + public interface ICreateStudentFromExisting : INamed, IOfAgeBornOn, IInSemester, ILivingIn, IWhoIsHappy, IWhoseFriendsAre + { + } + public interface INamed { IOfAgeBornOn Named(string firstName, string lastName); diff --git a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.g.cs b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.g.cs index 8cc576a..e0dce4d 100644 --- a/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.g.cs +++ b/src/M31.FluentApi.Tests/CodeGeneration/TestClasses/StudentClass/CreateStudent.g.cs @@ -13,6 +13,7 @@ namespace M31.FluentApi.Tests.CodeGeneration.TestClasses.StudentClass; public class CreateStudent : CreateStudent.ICreateStudent, + CreateStudent.ICreateStudentFromExisting, CreateStudent.INamed, CreateStudent.IOfAgeBornOn, CreateStudent.IInSemester, @@ -27,11 +28,21 @@ private CreateStudent() student = new Student(); } + private CreateStudent(Student student) + { + this.student = student; + } + public static ICreateStudent InitialStep() { return new CreateStudent(); } + public static ICreateStudentFromExisting FromExisting(Student student) + { + return new CreateStudent(student); + } + public static IOfAgeBornOn Named(string firstName, string lastName) { CreateStudent createStudent = new CreateStudent(); @@ -133,6 +144,10 @@ public interface ICreateStudent : INamed { } + public interface ICreateStudentFromExisting : INamed, IOfAgeBornOn, IInSemester, ILivingIn, IWhoIsHappy, IWhoseFriendsAre + { + } + public interface INamed { IOfAgeBornOn Named(string firstName, string lastName); diff --git a/src/M31.FluentApi/M31.FluentApi.csproj b/src/M31.FluentApi/M31.FluentApi.csproj index 9b432c0..65274cb 100644 --- a/src/M31.FluentApi/M31.FluentApi.csproj +++ b/src/M31.FluentApi/M31.FluentApi.csproj @@ -7,7 +7,7 @@ enable true true - 2.0.0 + 2.1.0 Kevin Schaal Generate fluent builders in C#. fluentapi fluentbuilder fluentinterface fluentdesign fluent codegeneration