/// <summary> /// Generates the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <param name="component">The component identifier.</param> /// <returns></returns> public string Generate(DatabaseEntity entity, GeneratorComponent component) { if (FormBaseTemplateConfiguration.Instance.ValidateForm()) { BaseGenerator generator = new BaseGenerator(Settings, entity); switch (component.Id) { case (int)eBaseTemplateComponent.SAVE: { return(generator.GenerateScriptSave()); } case (int)eBaseTemplateComponent.GET_BY_ID: { return(generator.GenerateScriptGetById()); } case (int)eBaseTemplateComponent.LIST_ALL: { return(generator.GenerateScriptListAll()); } case (int)eBaseTemplateComponent.DELETE: { return(generator.GenerateScriptDelete()); } } } return(string.Empty); }