Skip to main content

Definition

Assembly: CloudNimble.EasyAF.Tools.dll Namespace: CloudNimble.EasyAF.Tools.Commands Inheritance: CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand

Syntax

CloudNimble.EasyAF.Tools.Commands.InitCommand

Summary

Command for initializing EasyAF project configuration including database scaffolding, project types, and analyzer setup.

Constructors

.ctor

Initializes a new instance of the InitCommand class.

Syntax

public InitCommand(CloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManager configManager)

Parameters

NameTypeDescription
configManagerCloudNimble.EasyAF.EFCoreToEdmx.EdmxConfigManagerThe configuration manager service.

.ctor Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand

Syntax

protected EasyAFBaseCommand()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

ConnectionString

Gets or sets the connection string source.

Syntax

public string ConnectionString { get; set; }

Property Value

Type: string

ContextName

Gets or sets the DbContext class name.

Syntax

public string ContextName { get; set; }

Property Value

Type: string

DbContextNamespace

Gets or sets the namespace for the generated DbContext.

Syntax

public string DbContextNamespace { get; set; }

Property Value

Type: string

ExcludeTables

Gets or sets the tables to exclude.

Syntax

public string[] ExcludeTables { get; set; }

Property Value

Type: string[]

NoDataAnnotations

Gets or sets a value indicating whether to disable data annotations.

Syntax

public bool NoDataAnnotations { get; set; }

Property Value

Type: bool

NoPluralize

Gets or sets a value indicating whether to disable pluralization.

Syntax

public bool NoPluralize { get; set; }

Property Value

Type: bool

ObjectsNamespace

Gets or sets the namespace for the generated entity objects.

Syntax

public string ObjectsNamespace { get; set; }

Property Value

Type: string

Provider

Gets or sets the database provider.

Syntax

public string Provider { get; set; }

Property Value

Type: string

SimpleMessageBusProject

Gets or sets the SimpleMessageBus project name to create. If specified, creates a new SimpleMessageBus project.

Syntax

public string SimpleMessageBusProject { get; set; }

Property Value

Type: string

SolutionFolder

Gets or sets the working directory for the solution. Defaults to current directory.

Syntax

public string SolutionFolder { get; set; }

Property Value

Type: string

Tables

Gets or sets the specific tables to include.

Syntax

public string[] Tables { get; set; }

Property Value

Type: string[]

Methods

CheckMSBuildRegistered Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Ensures MSBuild is registered with the latest available version.

Syntax

protected static void CheckMSBuildRegistered()

ConfigureDirectoryBuildProps Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Configures Directory.Build.props with EasyAF namespace, UserSecretsId, and analyzer references using MSBuildProjectManager.

Syntax

protected static void ConfigureDirectoryBuildProps(string commonNamespace, string userSecretsId, string[] projectFiles)

Parameters

NameTypeDescription
commonNamespacestringThe common namespace to set.
userSecretsIdstringThe UserSecretsId to set.
projectFilesstring[]Array of project file paths.

ConfigureProjectTypes Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Discovers and configures project types and namespace for all projects in the current directory and subdirectories.

Syntax

protected static void ConfigureProjectTypes(string userSecretsId)

Parameters

NameTypeDescription
userSecretsIdstringThe UserSecretsId to set in Directory.Build.props.

DetectCommonNamespace Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Detects the common namespace from existing projects.

Syntax

protected static string DetectCommonNamespace(string[] projectFiles)

Parameters

NameTypeDescription
projectFilesstring[]Array of project file paths.

Returns

Type: string The detected common namespace, or null if none found.

DetermineProjectType Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Determines the EasyAFProjectType based on the project file name and content.

Syntax

protected static string DetermineProjectType(string projectFilePath)

Parameters

NameTypeDescription
projectFilePathstringThe path to the project file.

Returns

Type: string The determined project type, or null if no supported type is detected.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ExtractUserSecretsId Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Extracts the UserSecretsId from a project file using MSBuild evaluation. This will properly evaluate the project with all imports including Directory.Build.props.

Syntax

protected static string ExtractUserSecretsId(string projectFilePath)

Parameters

NameTypeDescription
projectFilePathstringThe path to the project file.

Returns

Type: string The UserSecretsId if found, otherwise null.

ExtractUserSecretsIdFromDataProject Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Extracts the UserSecretsId from the data project folder.

Syntax

protected static string ExtractUserSecretsIdFromDataProject(string dataFolder)

Parameters

NameTypeDescription
dataFolderstringThe data project folder path.

Returns

Type: string The UserSecretsId if found, otherwise null.

ExtractUserSecretsIdFromDirectoryBuildProps Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Extracts the UserSecretsId from Directory.Build.props in the current directory.

Syntax

protected static string ExtractUserSecretsIdFromDirectoryBuildProps()

Returns

Type: string The UserSecretsId if found, otherwise null.

FindCommonPrefix Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Finds the common prefix among a list of strings.

Syntax

protected static string FindCommonPrefix(System.Collections.Generic.List<string> strings)

Parameters

NameTypeDescription
stringsSystem.Collections.Generic.List<string>The list of strings to find common prefix for.

Returns

Type: string The common prefix.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

OnExecuteAsync

Executes the init command.

Syntax

public System.Threading.Tasks.Task<int> OnExecuteAsync()

Returns

Type: System.Threading.Tasks.Task<int> Exit code.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

SetProjectType Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Adds or updates the EasyAFProjectType property in a project file using MSBuildProjectManager.

Syntax

protected static void SetProjectType(string projectFilePath, string projectType)

Parameters

NameTypeDescription
projectFilePathstringThe path to the project file.
projectTypestringThe project type to set.

SetUserSecretAsync Inherited

Inherited from CloudNimble.EasyAF.Tools.Commands.EasyAFBaseCommand
Sets a user secret value using the official dotnet user-secrets CLI tool.

Syntax

protected static System.Threading.Tasks.Task SetUserSecretAsync(string userSecretsId, string key, string value, string projectPath)

Parameters

NameTypeDescription
userSecretsIdstringThe user secrets ID.
keystringThe secret key.
valuestringThe secret value.
projectPathstringThe project directory path.

Returns

Type: System.Threading.Tasks.Task

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?