ile nasıl geçerim Varsayılan değer olmayan bir parametresi olan bir saklı yordam var, ancak boş olabilir. Ama Dapper ile null geçmek nasıl anlayamıyorum. Bunu ADO'da yapabilirim.Boş bir parametreyi Dapper
connection.Execute("spLMS_UpdateLMSLCarrier", new { **RouteId = DBNull.Value**, CarrierId = carrierID, UserId = userID, TotalRouteRateCarrierId = totalRouteRateCarrierId },
commandType: CommandType.StoredProcedure);
İstisna:
System.NotSupportedException was caught
Message=The member RouteId of type System.DBNull cannot be used as a parameter value
Source=Dapper
StackTrace:
at Dapper.SqlMapper.LookupDbType(Type type, String name) in C:\Dev\dapper-git\Dapper\SqlMapper.cs:line 348
at Dapper.SqlMapper.CreateParamInfoGenerator(Identity identity) in C:\Dev\dapper-git\Dapper\SqlMapper.cs:line 1251
at Dapper.SqlMapper.GetCacheInfo(Identity identity) in C:\Dev\dapper-git\Dapper\SqlMapper.cs:line 908
at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) in C:\Dev\dapper-git\Dapper\SqlMapper.cs:line 532
at Rating.Domain.Services.OrderRatingQueueService.UpdateLMSLCarrier(Int32 totalRouteRateCarrierId, Int32 carrierID, Int32 userID) in C:\DevProjects\Component\Main\Source\Rating\Source\Rating.Domain\Services\OrderRatingQueueService.cs:line 52
at Benchmarking.Program.OrderRatingQueue() in C:\DevProjects\Component\Main\Source\Benchmarking\Source\Benchmarking\Program.cs:line 81
at Benchmarking.Program.Main(String[] args) in C:\DevProjects\Component\Main\Source\Benchmarking\Source\Benchmarking\Program.cs:line 28
InnerException:
RouteId kapalı bırakamam, bana gerekli olduğunu belirten bir hata veriyor. Düzenli boş kullanamazsınız ya da başka bir hata verir. Saklı yordamı değiştiremezsiniz, bana ait değil.
RouteId türü nedir? – driis
Bu bir int. Ve bir şey söylemeden önce unutmayın, bunu ADO’da istisnasız olarak yapabilirim. –