Custom Map

In some cases if a column needs to be mapped to a "C# enum", custom map file can be used to control how some code is generated for the Data Access Layer.

See Sample Custom Map file.

Custom map file tells the code generator to create enums with values taken from the custom map file. This way your code becomes more readable and you do not have to deal with integer values for columns like status etc.

The following code was generated using the information from the sample custom map file for GS SalesManager

public enum InvoiceStatusEnum{[Description("None")]None,[Description("Paid (All payments received)")]Paid,[Description("Part Paid")]PartPaid,[Description("Outstanding")]Outstanding,[Description("Written-off")]WrittenOff,[Description("Marked As Paid")]MarkedAsPaid}

The custom map file is not limited to enums only. You can also use it to map some columns to your custom NHibernate IUserType implementations!