Files

59 lines
2.1 KiB
C#

<Query Kind="Program">
<Connection>
<ID>77b65bea-e766-4e3c-a1ed-c4c2534b6019</ID>
<Persist>true</Persist>
<Server>D0001-SQL-01.sdt.local</Server>
<Database>jazz dev master</Database>
<ShowServer>true</ShowServer>
</Connection>
<Reference>&lt;ProgramFilesX64&gt;\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Newtonsoft.Json.dll</Reference>
<NuGetReference>Amazon.Lambda.Core</NuGetReference>
<NuGetReference>Amazon.Lambda.S3Events</NuGetReference>
<NuGetReference>Amazon.Lambda.Serialization.Json</NuGetReference>
<NuGetReference>Amazon.Lambda.TestUtilities</NuGetReference>
<NuGetReference>AWSSDK.Core</NuGetReference>
<NuGetReference>AWSSDK.S3</NuGetReference>
<Namespace>Newtonsoft.Json</Namespace>
<Namespace>Newtonsoft.Json.Converters</Namespace>
<Namespace>Newtonsoft.Json.Linq</Namespace>
<Namespace>Newtonsoft.Json.Schema</Namespace>
<Namespace>Newtonsoft.Json.Serialization</Namespace>
</Query>
class report
{
public Guid ReportGUID {get;set;}
public string Category {get;set;}
public string Module {get;set;}
public string Name {get;set;}
public string Description {get;set;}
public string Migration {get;set;}
public report(Guid reportGuid, string module, string name, string description)
{
ReportGUID = reportGuid;
Module = module;
Name = name;
Description = description;
Category = "Report";
Migration = string.Empty;
}
};
void Main()
{
var result = procMigrateGenerateAdHocMigration(new Guid("697C3E94-26F8-4F15-9F58-87F54541AD19"));
result.Dump();
var reportQuery = from rr in REReports
join f in Folders on rr.FolderGUID equals f.FolderGuid
where rr.IsPublished == true
select new report(rr.ReportGUID, f.Name , rr.Name, rr.Description);
// reportQuery.ToList()
// .ForEach(rpt => rpt.Migration = procMigrateGenerateAdHocMigration(rpt.ReportGUID));
var json = JsonConvert.SerializeObject(reportQuery.ToList().OrderBy(rpt => rpt.Module).ThenBy(rpt => rpt.Name), Newtonsoft.Json.Formatting.Indented);
json.Dump();
File.WriteAllText(@"C:\Users\tlamb\Documents\Reports.json", json);
}