Table of Contents

Class GeneratedFile

Namespace
ToSic.Sxc.Code.Generate
Assembly
ToSic.Sxc.Code.Generate.dll

Represents a generated file. It's usually provided in a IGeneratedFileSet, which contains additional specs.

[WorkInProgressApi("still being standardized")]
public class GeneratedFile : IGeneratedFile, IGeneratedFileInfo
Inheritance
GeneratedFile
Implements

Properties

Body

The body of the file, which will be written to the file.

public string Body { get; init; }

Property Value

string

Dependencies

List of dependencies which are required to create this file.

For example, if we generate a PersonList.cshtml which will inherit the AppRazor, then the AppRazor should be in the list.

Note: not implemented yet - this is for later when users may want to select which files to generate.

public IReadOnlyCollection<IGeneratedFileInfo> Dependencies { get; init; }

Property Value

IReadOnlyCollection<IGeneratedFileInfo>

FileName

The file name of the final code file, with extension. May not contain any slashes.

public string FileName { get; init; }

Property Value

string

Path

The path to put the file in, relative to the root which is determined elsewhere. May not begin or end with a slash.

Example: if path is "Data" and the root is "AppCode", the file will be saved to "AppCode\Data\FileName.cs"

public string Path { get; init; }

Property Value

string