I have a stored procedure "GET_PARTNER" like this:
SELECT
...
Partners.name AS 'name' -nvarchar
Partners.city AS 'city' -nvarchar
NULL AS 'sales' -money
NULL AS 'comments' -nvarchar
...
I have added entity framework 6 to the project and set it to create model from database and it creates a model "GET_PARTNER_Result" like this:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WSExport.Model
{
using System;
public partial class GET_PARTNER_Result
{
public string name {get; set;}
public string city {get; set;}
public Nullable<int> sales {get; set;} -wrong datatype
public Nullable<int> comments {get; set;} -wrong datatype
}
}
How can I modify the stored procedure, or is it possible to configure ef so it will create the model with the correct datatypes? Like this:
public Nullable<decimal> sales {get; set;}
public string comments {get; set;}