Dapper-FluentMap
Dapper-FluentMap copied to clipboard
Even DatabaseGeneratedOption.Computed is used for property, FluentMap.Dommel still generates column and parameter names in insert\update query
.NET Core 3.1 Win 10 64 bit Dommel 2.1.0 Dapper 2.0.35 Dapper-FluentMap.Dommel 2.0.0
Even DatabaseGeneratedOption.Computed is used for property, Dapper.FluentMap.Dommel still generates column and parameter names in insert\update query, but it should skip them.
public sealed class DommelChargeMap : DommelEntityMap<ChargeDb>
{
public DommelChargeMap()
{
Map(x => x.RowVersion).SetGeneratedOption(DatabaseGeneratedOption.Computed);
}
}
But the insert and update has "RowVersion" and "@RowVersion" in result query.
How to archive not include such column in query?
Can you show the Dapper.FluentMap initialization code. Did you call ForDommel()
at application startup?
You can also try to use the [DontMap]
or [Ignore]
attribute on the property of the ChargeDb
class. This will omit the column from insert/update statements without using Dapper.FluentMap.
Hi, I do call ForDommel()
namespace MyCustom.Data.Client.Dommel
{
using Dapper.FluentMap;
using Dapper.FluentMap.Dommel;
using MyCustom.Data.Client.Dommel.EntityMaps;
using global::Dommel;
public sealed class DommelForClientDatabase
{
public static void Setup()
{
FluentMapper.Initialize(config =>
{
config.AddMap(new DommelChargeMap());
config.ForDommel();
});
}
}
}
It is being called in Startup.cs
:
public void ConfigureServices(IServiceCollection services)
{
services
.AddControllersWithViews()
.AddNewtonsoftJson();
// .... other code removed for brevity
DommelForClientDatabase.Setup();
}
This issue seems to be similar to #122
Is this bug fixed?
@DanieleSky , I'm afraid it is not. But I did not check
I'm archiving this repository as I'm not using this library myself anymore and have no time maintaining it. Thanks for using it.