That thing consumed sometime from me so i thought of writing it so it could save someone else's time. When you return @@Identity or scope_identity() from a Sql Server stored procedure it will be seen by the EF as a decimal not an int so the first step here will be making a casting in the stored [...]