Class EntityWriter
Used to write the entity class definition for an existing LemonEdge entity Interface (obtained either from custom .net code (must be marked with EntityDefinition) or a ICustomObject)
Inheritance
Inherited Members
Namespace: LemonEdge.API.Descriptors.Writers
Assembly: API.dll
Syntax
public static class EntityWriter
Methods
AddFileFooterAndCloseNamespaces(ClassFileWriter)
Closes the [LemonEdge.Entities] namespace started by AddFileHeadersAndNamespace(ClassFileWriter, String)
Declaration
public static void AddFileFooterAndCloseNamespaces(ClassFileWriter writer)
Parameters
Type | Name | Description |
---|---|---|
ClassFileWriter | writer | The writer to close the namespace on |
AddFileHeadersAndNamespace(ClassFileWriter, String)
Adds the standard using statements required for the entity defintion code to work correctly in LemonEdge, and starts the namespace [LemonEdge.Entities]
Declaration
public static void AddFileHeadersAndNamespace(ClassFileWriter writer, string customUsing)
Parameters
Type | Name | Description |
---|---|---|
ClassFileWriter | writer | The writer to add the using statements to |
System.String | customUsing | Optionally any custom using statements for the entity to reference specified types |
WriteFile(EntityDescriptor, String)
Writes a whole file for the specified entity descriptor interface with an optional custom using
Declaration
public static string WriteFile(EntityDescriptor descriptor, string customUsing)
Parameters
Type | Name | Description |
---|---|---|
EntityDescriptor | descriptor | An entitydescriptor describing the interface. This is loaded dynamically from an interface type, or for a custom object from CreateTempFrom(ICustomObject, IEnumerable<ICustomObjectProperty>) |
System.String | customUsing | Optionally any custom using statements for the entity to reference specified types |
Returns
Type | Description |
---|---|
System.String | A string of the complete c# code for this entity |
WriteToFile(EntityDescriptor, ClassFileWriter, IEnumerable<ICustomObjectProperty>)
Write the entity class defintion for an existing LemonEdge entity Interface (obtained either from custom .net code (must be marked with EntityDefinition) or a ICustomObject)
Declaration
public static void WriteToFile(EntityDescriptor descriptor, ClassFileWriter writer, IEnumerable<ICustomObjectProperty> props)
Parameters
Type | Name | Description |
---|---|---|
EntityDescriptor | descriptor | An entitydescriptor describing the interface. This is loaded dynamically from an interface type, or for a custom object from CreateTempFrom(ICustomObject, IEnumerable<ICustomObjectProperty>) |
ClassFileWriter | writer | The writer to add the generated code to |
System.Collections.Generic.IEnumerable<ICustomObjectProperty> | props | If this interface comes from a ICustomObject then this optionally holds the custom object properties, used to provide custom attributes and validation to the generated interface |