I am using .net as backend, and SQL Server as the database. I am inserting records into the database in 2 ways, first way is using the crud operations and the second way using a SQL Server stored procedure that is called using dapper.
When using Dapper, the long string is auto trimmed, but when using the crud operations, the insert fails with the following error:
String or binary data would be truncated
I just want to know if Dapper is responsible for trimming these strings on its own or not.
Here is the code:
int result = await unitOfWork.GetService<IUserService>().AddUserAsync(userModel); // here I get an error during insert
and here using dapper:
return await GetDapper().ExcecuteScalarAsync<int>("dbo.insert_user", new { @userId = userId, @userName = userName });