public static EntityClassDefinition GetEntityClassDefinition(this DapperProject project, StoredProcedure storedProcedure)
        {
            var definition = new EntityClassDefinition
            {
                Namespaces =
                {
                    "System"
                },
                Namespace      = project.Database.HasDefaultSchema(storedProcedure) ? project.GetEntityLayerNamespace() : project.GetEntityLayerNamespace(storedProcedure.Schema),
                AccessModifier = AccessModifier.Public,
                Name           = project.GetResultName(storedProcedure),
                Constructors   =
                {
                    new ClassConstructorDefinition(AccessModifier.Public)
                }
            };

            foreach (var resultSet in storedProcedure.FirstResultSetsForObject)
            {
                var type = project.Database.ResolveDatabaseType(resultSet.SystemTypeName);

                definition.Properties.Add(new PropertyDefinition
                {
                    AccessModifier = AccessModifier.Public,
                    Type           = type,
                    Name           = resultSet.Name,
                    IsAutomatic    = true
                });
            }

            return(definition);
        }
        public static EntityClassDefinition GetEntityClassDefinition(this DapperProject project, ITableFunction tableFunction)
        {
            var definition = new EntityClassDefinition
            {
                Namespaces =
                {
                    "System"
                },
                Namespace      = project.Database.HasDefaultSchema(tableFunction) ? project.GetEntityLayerNamespace() : project.GetEntityLayerNamespace(tableFunction.Schema),
                AccessModifier = AccessModifier.Public,
                Name           = project.GetResultName(tableFunction),
                Constructors   =
                {
                    new ClassConstructorDefinition(AccessModifier.Public)
                }
            };

            if (!string.IsNullOrEmpty(tableFunction.Description))
            {
                definition.Documentation.Summary = tableFunction.Description;
            }

            var selection = project.GetSelection(tableFunction);

            foreach (var column in tableFunction.Columns)
            {
                definition.Properties.Add(new PropertyDefinition
                {
                    AccessModifier = AccessModifier.Public,
                    Type           = project.Database.ResolveDatabaseType(column),
                    Name           = project.GetPropertyName(column.Name),
                    IsAutomatic    = true
                });
            }

            definition.Implements.Add("IEntity");

            if (selection.Settings.SimplifyDataTypes)
            {
                definition.SimplifyDataTypes();
            }

            return(definition);
        }