-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let type inference work on the return type of the methode of controllers
- Loading branch information
Cyril Gandon
committed
Oct 5, 2016
1 parent
a26788b
commit c402f11
Showing
10 changed files
with
70 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Nimrod | ||
{ | ||
public enum FileType { Controller, Model, Struct, Enum } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Runtime.Serialization.Json; | ||
|
||
namespace Nimrod | ||
{ | ||
public class GeneratorResult | ||
{ | ||
public List<string> Services { get; } | ||
public List<string> Models { get; } | ||
public List<FileToWrite> Files { get; } | ||
|
||
public GeneratorResult(List<string> services, List<string> models, List<FileToWrite> files) | ||
{ | ||
this.Services = services.ThrowIfNull(nameof(services)); | ||
this.Models = models.ThrowIfNull(nameof(models)); | ||
this.Files = files.ThrowIfNull(nameof(files)); | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
using (var stream = new MemoryStream()) | ||
{ | ||
var serializer = new DataContractJsonSerializer(typeof(GeneratorResult)); | ||
serializer.WriteObject(stream, this); | ||
stream.Position = 0; | ||
using (var reader = new StreamReader(stream)) | ||
{ | ||
return reader.ReadToEnd(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters