I have a simple class:
public class User { public Guid Id{ get; set; } public string UserName { get; set; } public byte[] RowVersion { get; set; } }
The column in the Db tabale column is set to auto. When I insert user with dapper
var result = db.Execute("[dbo].[User_Insert]", user, trans,commandType:CommandType.StoredProcedure);
Dapper generates a parameter for the all property, and I get an error similar to this
The procedure or function User_Insert contains too many arguments.
How to ignore rowversion in dapper parameter?
My procedure code:
ALTER PROCEDURE [In4].[User_Insert] @Id uniqueidentifier, @UserName nvarchar(4000)= NULL AS BEGIN insert into [In4].[Users] ([Id], [UserName]) VALUES (@Id, @UserName) End
source share