Skip to content

Commit

Permalink
fix --useSqlite for mac scenarios (#2241)
Browse files Browse the repository at this point in the history
* Revert "Update dependencies from https://github.com/dotnet/efcore build 20230113.1 (#2234)"

This reverts commit 5f9352e.

* Revert "[release/7.0] Update dependencies from dotnet/aspnetcore (#2232)"

This reverts commit fe0e787.

* Revert "Update dependencies from https://github.com/dotnet/aspnetcore build 20230112.7 (#2229)"

This reverts commit 86d5b52.

* Revert "Update dependencies from https://github.com/dotnet/efcore build 20230112.8 (#2230)"

This reverts commit 9063024.

* Revert "[release/7.0] Update dependencies from dotnet/aspnetcore (#2192)"

This reverts commit 2530114.

* Revert "Update dependencies from https://github.com/dotnet/efcore build 20230112.2 (#2226)"

This reverts commit cdf6b6f.

* Revert "Update dependencies from https://github.com/dotnet/efcore build 20230111.6 (#2222)"

This reverts commit 5efa6d8.

* Revert "Update dependencies from https://github.com/dotnet/efcore build 20230111.2 (#2218)"

This reverts commit bc7f508.

* Revert "Update dependencies from https://github.com/dotnet/arcade build 20230110.4 (#2219)"

This reverts commit a707da7.

* Revert "[release/7.0] Update dependencies from dotnet/efcore (#2191)"

This reverts commit a311109.

* adding --useSqlite back

* added comment.

* updating 7.0.1 dependencies to 7.0.2

* remove ShortName for duplicate UseSqlite CommandLineOption

* minor fix

* minor fix, cmd line validation for razor page crud
  • Loading branch information
deepchoudhery committed Jan 23, 2023
1 parent 5f9352e commit 4339775
Show file tree
Hide file tree
Showing 20 changed files with 104 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -13,7 +13,7 @@ insert_final_newline = true

[*.cs]
indent_size = 4
dotnet_sort_system_directives_first = true:warning
dotnet_sort_system_directives_first = true

[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
indent_size = 2
Expand Down
4 changes: 2 additions & 2 deletions NuGet.config
Expand Up @@ -4,10 +4,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-aspnetcore -->
<add key="darc-pub-dotnet-aspnetcore-b6bd323" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-b6bd3236/nuget/v3/index.json" />
<add key="darc-pub-dotnet-aspnetcore-26e3dfc" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-26e3dfc7/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-aspnetcore -->
<!-- Begin: Package sources from dotnet-efcore -->
<add key="darc-pub-dotnet-efcore-00e218a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-efcore-00e218a9/nuget/v3/index.json" />
<add key="darc-pub-dotnet-efcore-09261bb" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-efcore-09261bb9/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-efcore -->
<!-- Package sources from dotnet-efcore -->
<!-- Package sources from dotnet-runtime -->
Expand Down
36 changes: 18 additions & 18 deletions eng/Version.Details.xml
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.23060.4">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22561.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ac5977ebf05451c1adcf24a15d16263e4d25fd0c</Sha>
<Sha>f36ea231c234560514ede4c2747897a737ced28f</Sha>
</Dependency>
</ToolsetDependencies>
<ProductDependencies>
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.1">
<Uri>https://github.com/dotnet/efcore</Uri>
<Sha>00e218a90498c21ec14bbaf730a8954c03b42a34</Sha>
<Sha>09261bb997c0d82e121cd348d2e43f2b37a65848</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.1">
<Uri>https://github.com/dotnet/efcore</Uri>
<Sha>00e218a90498c21ec14bbaf730a8954c03b42a34</Sha>
<Sha>09261bb997c0d82e121cd348d2e43f2b37a65848</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.3">
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1">
<Uri>https://github.com/dotnet/efcore</Uri>
<Sha>00e218a90498c21ec14bbaf730a8954c03b42a34</Sha>
<Sha>09261bb997c0d82e121cd348d2e43f2b37a65848</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="7.0.2">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand All @@ -27,9 +27,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha />
</Dependency>
<Dependency Name="Microsoft.Extensions.Identity.Stores" Version="7.0.3">
<Dependency Name="Microsoft.Extensions.Identity.Stores" Version="7.0.1">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>b6bd3236cda202c27f0f8b40900ba49aa725519e</Sha>
<Sha>26e3dfc7f3f3a91ba445ec0f8b1598d12542fb9f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.2">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand All @@ -51,9 +51,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha />
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.3">
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.1">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>b6bd3236cda202c27f0f8b40900ba49aa725519e</Sha>
<Sha>26e3dfc7f3f3a91ba445ec0f8b1598d12542fb9f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="7.0.2">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand All @@ -71,17 +71,17 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha />
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.3">
<Dependency Name="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.1">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>b6bd3236cda202c27f0f8b40900ba49aa725519e</Sha>
<Sha>26e3dfc7f3f3a91ba445ec0f8b1598d12542fb9f</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.3">
<Dependency Name="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.1">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>b6bd3236cda202c27f0f8b40900ba49aa725519e</Sha>
<Sha>26e3dfc7f3f3a91ba445ec0f8b1598d12542fb9f</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Identity.UI" Version="7.0.3">
<Dependency Name="Microsoft.AspNetCore.Identity.UI" Version="7.0.1">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>b6bd3236cda202c27f0f8b40900ba49aa725519e</Sha>
<Sha>26e3dfc7f3f3a91ba445ec0f8b1598d12542fb9f</Sha>
</Dependency>
</ProductDependencies>
</Dependencies>
18 changes: 9 additions & 9 deletions eng/Versions.props
Expand Up @@ -12,17 +12,17 @@
<MicrosoftBuildUtilitiesCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildUtilitiesCorePackageVersion>
<!-- Ref packages from darc subscriptions-->
<!-- Microsoft.EntityFrameworkCore.Design -->
<MicrosoftEntityFrameworkCoreDesignPackageVersion>7.0.3</MicrosoftEntityFrameworkCoreDesignPackageVersion>
<MicrosoftEntityFrameworkCoreDesignPackageVersion>7.0.2</MicrosoftEntityFrameworkCoreDesignPackageVersion>
<!-- Microsoft.EntityFrameworkCore -->
<MicrosoftEntityFrameworkCorePackageVersion>7.0.3</MicrosoftEntityFrameworkCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>7.0.2</MicrosoftEntityFrameworkCorePackageVersion>
<!-- Microsoft.EntityFrameworkCore.SqlServer -->
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>7.0.3</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>7.0.2</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftExtensionsDependencyInjectionPackageVersion>
</MicrosoftExtensionsDependencyInjectionPackageVersion>
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
<!-- Microsoft.Extensions.Identity.Stores -->
<MicrosoftExtensionsIdentityStoresPackageVersion>7.0.3</MicrosoftExtensionsIdentityStoresPackageVersion>
<MicrosoftExtensionsIdentityStoresPackageVersion>7.0.2</MicrosoftExtensionsIdentityStoresPackageVersion>
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
Expand All @@ -34,7 +34,7 @@
<MicrosoftExtensionsDependencyModelPackageVersion>
</MicrosoftExtensionsDependencyModelPackageVersion>
<!-- Microsoft.Extensions.FileProviders.Embedded -->
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>7.0.3</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>7.0.2</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>
</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftExtensionsLoggingDebugPackageVersion>
Expand All @@ -44,14 +44,14 @@
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
<!-- Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore -->
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>7.0.3</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
<MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>7.0.2</MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion>
<!-- Microsoft.AspNetCore.Identity.EntityFrameworkCore -->
<MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>7.0.3</MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>
<MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>7.0.2</MicrosoftAspNetCoreIdentityEntityFrameworkCorePackageVersion>
<!-- Microsoft.AspNetCore.Identity.UI -->
<MicrosoftAspNetCoreIdentityUIPackageVersion>7.0.3</MicrosoftAspNetCoreIdentityUIPackageVersion>
<MicrosoftAspNetCoreIdentityUIPackageVersion>7.0.2</MicrosoftAspNetCoreIdentityUIPackageVersion>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>7.0.2</VersionPrefix>
<VersionPrefix>7.0.3</VersionPrefix>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<IncludeSourceRevisionInInformationalVersion>False</IncludeSourceRevisionInInformationalVersion>
<IsServicingBuild Condition="'$(PreReleaseVersionLabel)' == 'servicing'">true</IsServicingBuild>
Expand Down
7 changes: 0 additions & 7 deletions eng/common/cross/toolchain.cmake
@@ -1,12 +1,5 @@
set(CROSS_ROOTFS $ENV{ROOTFS_DIR})

# reset platform variables (e.g. cmake 3.25 sets LINUX=1)
unset(LINUX)
unset(FREEBSD)
unset(ILLUMOS)
unset(ANDROID)
unset(TIZEN)

set(TARGET_ARCH_NAME $ENV{TARGET_BUILD_ARCH})
if(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)
set(CMAKE_SYSTEM_NAME FreeBSD)
Expand Down
2 changes: 1 addition & 1 deletion eng/common/sdk-task.ps1
Expand Up @@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.4.1" -MemberType NoteProperty
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.3.1" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true
Expand Down
6 changes: 0 additions & 6 deletions eng/common/templates/steps/source-build.yml
Expand Up @@ -63,11 +63,6 @@ steps:
targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}'
fi
runtimeOsArgs=
if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then
runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}'
fi
publishArgs=
if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then
publishArgs='--publish'
Expand All @@ -80,7 +75,6 @@ steps:
$internalRuntimeDownloadArgs \
$internalRestoreArgs \
$targetRidArgs \
$runtimeOsArgs \
/p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \
/p:ArcadeBuildFromSource=true
displayName: Build
Expand Down
4 changes: 2 additions & 2 deletions eng/common/tools.ps1
Expand Up @@ -365,8 +365,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =

# If the version of msbuild is going to be xcopied,
# use this version. Version matches a package here:
# https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.4.1&view=overview
$defaultXCopyMSBuildVersion = '17.4.1'
# https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet-eng&package=RoslynTools.MSBuild&protocolType=NuGet&version=17.3.1view=overview
$defaultXCopyMSBuildVersion = '17.3.1'

if (!$vsRequirements) {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {
Expand Down
2 changes: 1 addition & 1 deletion eng/common/tools.sh
Expand Up @@ -511,7 +511,7 @@ global_json_file="${repo_root}global.json"
# determine if global.json contains a "runtimes" entry
global_json_has_runtimes=false
if command -v jq &> /dev/null; then
if jq -e '.tools | has("runtimes")' "$global_json_file" &> /dev/null; then
if jq -er '. | select(has("runtimes"))' "$global_json_file" &> /dev/null; then
global_json_has_runtimes=true
fi
elif [[ "$(cat "$global_json_file")" =~ \"runtimes\"[[:space:]\:]*\{ ]]; then
Expand Down
6 changes: 3 additions & 3 deletions global.json
@@ -1,12 +1,12 @@
{
"tools": {
"dotnet": "7.0.102"
"dotnet": "7.0.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.23060.4"
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22561.2"
},
"sdk": {
"version": "7.0.102",
"version": "7.0.100",
"allowPrerelease": true
}
}
8 changes: 4 additions & 4 deletions scripts/install-aspnet-codegenerator.cmd
@@ -1,11 +1,11 @@
set VERSION=8.0.0-dev
set VERSION=7.0.3
set DEFAULT_NUPKG_PATH=%userprofile%\.nuget\packages
set SRC_DIR=%cd%
set NUPKG=artifacts/packages/Debug/Shipping/
call taskkill /f /im dotnet.exe
call rd /Q /S artifacts
call build
call dotnet tool uninstall -g dotnet-aspnet-codegenerator
call dotnet tool uninstall -g dotnet-aspnet-codegenerator

call cd %DEFAULT_NUPKG_PATH%
call C:
Expand All @@ -18,7 +18,7 @@ call rd /Q /S microsoft.visualstudio.web.codegeneration.templating
call rd /Q /S microsoft.visualstudio.web.codegeneration.utils
call rd /Q /S microsoft.visualstudio.web.codegenerators.mvc
call D:
call cd %SRC_DIR%/%NUPKG%
call cd %SRC_DIR%/%NUPKG%
call dotnet tool install -g dotnet-aspnet-codegenerator --add-source %SRC_DIR%\%NUPKG% --version %VERSION%
call cd %SRC_DIR%
call taskkill /f /im dotnet.exe
call taskkill /f /im dotnet.exe
34 changes: 20 additions & 14 deletions src/Scaffolding/VS.Web.CG.EFCore/EntityFrameworkModelProcessor.cs
Expand Up @@ -10,13 +10,13 @@
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.DotNet.Scaffolding.Shared;
using Microsoft.DotNet.Scaffolding.Shared.Project;
using Microsoft.DotNet.Scaffolding.Shared.ProjectModel;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.DotNet.Scaffolding.Shared;
using Microsoft.DotNet.Scaffolding.Shared.ProjectModel;
using Microsoft.VisualStudio.Web.CodeGeneration.DotNet;
using Microsoft.DotNet.Scaffolding.Shared.Project;

namespace Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
{
Expand Down Expand Up @@ -44,7 +44,7 @@ internal class EntityFrameworkModelProcessor
private EditSyntaxTreeResult _programEditResult;
private IFileSystem _fileSystem;

public EntityFrameworkModelProcessor (
public EntityFrameworkModelProcessor(
string dbContextFullTypeName,
ModelType modelTypeSymbol,
string areaName,
Expand Down Expand Up @@ -95,7 +95,7 @@ public async Task Process()
{
throw new InvalidOperationException(string.Format(MessageStrings.ModelTypeNotFound, "Program"));
}

if (!dbContextSymbols.Any())
{
await GenerateNewDbContextAndRegisterProgramFile(programType, _applicationInfo);
Expand Down Expand Up @@ -224,8 +224,8 @@ public async Task Process()
}


public ContextProcessingStatus ContextProcessingStatus { get; private set;}
public ModelMetadata ModelMetadata { get; private set;}
public ContextProcessingStatus ContextProcessingStatus { get; private set; }
public ModelMetadata ModelMetadata { get; private set; }

/// <summary>
/// Writes the DbContext to disk using the given Roslyn SyntaxTree.
Expand Down Expand Up @@ -270,9 +270,9 @@ private async Task EnsureDbContextInLibraryIsValid(ModelType dbContextSymbol)
return c;
});

var dbContextType = _reflectedTypesProvider.GetReflectedType(_dbContextFullTypeName, lookInDependencies:true);
var dbContextType = _reflectedTypesProvider.GetReflectedType(_dbContextFullTypeName, lookInDependencies: true);

if (_reflectedTypesProvider.GetCompilationErrors() != null
if (_reflectedTypesProvider.GetCompilationErrors() != null
&& _reflectedTypesProvider.GetCompilationErrors().Any())
{
throw new InvalidOperationException(string.Format(
Expand All @@ -299,7 +299,7 @@ private async Task EnsureDbContextInLibraryIsValid(ModelType dbContextSymbol)
private async Task AddModelTypeToExistingDbContextIfNeeded(ModelType dbContextSymbol, IApplicationInfo appInfo)
{
bool nullabledEnabled = "enable".Equals(_projectContext.Nullable, StringComparison.OrdinalIgnoreCase);
var addResult = _dbContextEditorServices.AddModelToContext(dbContextSymbol, _modelTypeSymbol, new Dictionary<string, string> { { "nullableEnabled", nullabledEnabled.ToString()} });
var addResult = _dbContextEditorServices.AddModelToContext(dbContextSymbol, _modelTypeSymbol, new Dictionary<string, string> { { "nullableEnabled", nullabledEnabled.ToString() } });
var projectCompilation = await _workspace.CurrentSolution.Projects
.First(project => project.AssemblyName == _projectContext.AssemblyName)
.GetCompilationAsync();
Expand Down Expand Up @@ -368,7 +368,10 @@ private async Task GenerateNewDbContextAndRegisterProgramFile(ModelType programT
};

// Validate for necessary ef packages (based on database type)
EFValidationUtil.ValidateEFDependencies(_projectContext.PackageDependencies, _databaseProvider);
if (CalledFromCommandline)
{
EFValidationUtil.ValidateEFDependencies(_projectContext.PackageDependencies, _databaseProvider);
}

// Create a new Context
_logger.LogMessage(string.Format(MessageStrings.GeneratingDbContext, _dbContextFullTypeName));
Expand Down Expand Up @@ -438,8 +441,11 @@ private async Task GenerateNewDbContextAndRegister(ModelType startupType, ModelT
Edited = false
};

// Validate for necessary ef packages (based on database type)
EFValidationUtil.ValidateEFDependencies(_projectContext.PackageDependencies, _databaseProvider);
if (CalledFromCommandline)
{
// Validate for necessary ef packages (based on database type)
EFValidationUtil.ValidateEFDependencies(_projectContext.PackageDependencies, _databaseProvider);
}

// Create a new Context
_logger.LogMessage(string.Format(MessageStrings.GeneratingDbContext, _dbContextFullTypeName));
Expand Down Expand Up @@ -526,7 +532,7 @@ private ModelMetadata GetModelMetadata(Type dbContextType, Type modelType, Type
{
entityType = dbContextInstance.Model.FindEntityType(modelType);
}
catch(Exception ex)
catch (Exception ex)
{
// We got an exception from the DbContext while finding the entityType.
// The error here is useful to the user for taking corrective actions.
Expand Down
Expand Up @@ -20,6 +20,11 @@ public abstract class CommonCommandLineModel
[Option(Name = "useSqLite", ShortName = "sqlite", Description = "Flag to specify if DbContext should use SQLite instead of SQL Server.")]
public bool UseSqlite { get; set; }

//adding UseSqlite2 for backwards compat. for VS Mac scenarios (casing issue).
[Obsolete("Use --databaseProvider or -dbProvider to configure database type instead")]
[Option(Name = "useSqlite", Description = "Flag to specify if DbContext should use SQLite instead of SQL Server.")]
public bool UseSqlite2 { get; set; }

[Option(Name = "databaseProvider", ShortName = "dbProvider", Description = "Database provider to use. Options include 'sqlserver' (default), 'sqlite', 'cosmos', 'postgres'.")]
public string DatabaseProviderString { get; set; }
public DbProvider DatabaseProvider { get; set; }
Expand Down Expand Up @@ -72,7 +77,7 @@ public static void ValidateCommandline(this CommonCommandLineModel model, ILogge
}

#pragma warning disable CS0618 // Type or member is obsolete
if (model.UseSqlite)
if (model.UseSqlite || model.UseSqlite2)
{
#pragma warning restore CS0618 // Type or member is obsolete
//instead of throwing an error, letting the devs know that its obsolete.
Expand Down

0 comments on commit 4339775

Please sign in to comment.