jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
861 stars 145 forks source link

Incorrect value returned for data type money in sql server #484

Closed Hoang-Minh closed 2 years ago

Hoang-Minh commented 2 years ago

Describe the bug

I am using Insight.Database version 6.3.10 for SQL Server ORM, using C# as the client. I have a run into an issue where the mapping does not return a correct value for money column data type.

Steps to reproduce

DROP TABLE IF EXISTS dbo.MyTestTable;

CREATE TABLE dbo.MyTestTable ( AmountToAllocate MONEY ) GO

INSERT INTO dbo.MyTestTable VALUES(177279.73) GO

CREATE OR ALTER PROC [dbo].[MyTestProc]
AS BEGIN

SELECT TOP 1 m.AmountToAllocate FROM dbo.MyTestTable m

END GO

DROP TABLE IF EXISTS dbo.MyTestTable;

CREATE TABLE dbo.MyTestTable ( AmountToAllocate MONEY ) GO

INSERT INTO dbo.MyTestTable VALUES(177279.73) GO

CREATE OR ALTER PROC [dbo].[MyTestProc]
AS BEGIN

SELECT TOP 1 m.AmountToAllocate FROM dbo.MyTestTable m

END GO

Now, if I execute the store proc with Insight.Database, the returned object has AmountToAllocate property, but its value is 0, instead of 177279.73.

Expected behavior

It should return 177279.73 instead of 0

Hoang-Minh commented 2 years ago

I'm closing this issue since I was calling a different stored proc name.