-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add used options to output of code generated, issue #35
- Loading branch information
1 parent
c8095fe
commit 54b798c
Showing
7 changed files
with
82 additions
and
20 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
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,39 @@ | ||
using OData2Poco.TextTransform; | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace OData2Poco | ||
{ | ||
public class CodeHeader | ||
{ | ||
static List<string> Parameters = new List<string>(); | ||
public static string GetHeader(IPocoGenerator pocoGen) | ||
{ | ||
var comment = @"//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated using OData2Poco System. | ||
// Service Url: {0} | ||
// MetaData Version: {1} | ||
// Generated On: {2} | ||
// Parameters: | ||
{3} | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
"; | ||
|
||
//The <auto-generated> tag at the start of the file | ||
var h = new FluentCsTextTemplate(); | ||
var pp = Parameters.Where(x => !(x.Trim().StartsWith("-r") || x.Trim().StartsWith("--url"))) | ||
.Select(x => $"// \t{x}"); | ||
h.WriteLine(comment, pocoGen.MetaData.ServiceUrl, pocoGen.MetaData.MetaDataVersion, | ||
DateTimeOffset.Now.ToString("s"), string.Join(Environment.NewLine, pp)); | ||
return h.ToString(); | ||
} | ||
public static void SetParameters(List<string> parameters) | ||
{ | ||
Parameters = new List<string>(parameters); | ||
} | ||
} | ||
} |
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