Replies: 6 comments
-
You have two options:
The reason why example 2 works (and doesn't require a custom constructor) is because you're explicitly specifying a schema. The default version table must use the convention set to apply it. I'll leave this issue open as a reminder to update the documentation. Example 1services.AddScoped<IVersionTableMetaData, VersionTable>() Example 2 [VersionTableMetaData]
public class VersionTable : IVersionTableMetaData
{
public string ColumnName => "Version";
public string SchemaName => "distribution";
public string TableName => "T_SCHEMA_VERSION_INFO";
public string UniqueIndexName => "UC_Version";
public string AppliedOnColumnName => "AppliedOn";
public string DescriptionColumnName => "Description";
public object ApplicationContext { get; set; }
} EDIT: Fixed examples |
Beta Was this translation helpful? Give feedback.
-
In In Here's what I used instead:
|
Beta Was this translation helpful? Give feedback.
-
Would it be an option to simply remove the constructor parameters of |
Beta Was this translation helpful? Give feedback.
-
Yes, you're right. Registering it the way you did is correct. I fixed the examples. I'll think about removing the constructor without requiring to apply the convention set at every place where the version table metadata is required. |
Beta Was this translation helpful? Give feedback.
-
Or, IMHO, a more elegant option would be to add a
|
Beta Was this translation helpful? Give feedback.
-
I am migrating a pre .net core FluentMIgrator project to the new .net core version. I had a custom VersionTable that looked like this:
This results in the following warning/error:
I fixed this error by changing my code to this (removed attribute & added constructor):
This compiles correctly. But then, I don't know what I have to add in my
CreateServices
function:So the
WithVersionTable
expects an instance ofIVersionTableMetaData
. Unfortunately, I don't know what to use for theconvensionset
andrunnerOptions
parameters.Could you please provide some guidance and document them here? I have the feeling that this documentation is out of date.
Beta Was this translation helpful? Give feedback.
All reactions