Hi kas12345,
Refer below code.
public string InsertCustomer(CustomerModel customer)
{
SqlParameter pId = new SqlParameter("@CustomerId", customer.CustomerId);
SqlParameter pName = new SqlParameter("@Name", customer.Name);
SqlParameter pCountry = new SqlParameter("@Country", customer.Country);
var pOutId = new SqlParameter
{
ParameterName = "Id",
DbType = System.Data.DbType.String,
Size = 100,
Direction = System.Data.ParameterDirection.Output
};
var result = this.Database.ExecuteSqlCommand("EXECUTE Customers_InsertCustomer @CustomerId,@Name,@Country,@Id", pId, pName, pCountry, pOutId);
return Convert.ToString(result.Value);
}