I have created my domain using the below command and it works fine
Scaffold-DbContext -Connection name=MyConnectionStringName -Provider Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force -Project My.Domain -StartupProject My.Api
I am migrating some code from a manual process of creating the domains, the original didn't have the AuditApp column defined which is defaulted in the database to the App=MyApi
in the connection string. Here is the default constraint defined in the database:
ALTER TABLE [dbo].[PriceGroups] ADD CONSTRAINT [DF_PriceGroups_AuditApp] DEFAULT (rtrim(isnull(app_name(),''))) FOR [AuditApp]
Now that I have this column in the scaffold output I get this error when I try and add an object
Cannot insert the value NULL into column 'AuditApp'
Is there a way for me to bypass this so that it doesn't pass it? or am I going to have to do a manual domain approach :/ ?
...
public string AuditApp { get; set; }
...
I will be wanting to run the scaffold tool often so need a solution that does not mean I have to change the auto generated code.