public decimal?Add(QoalaEntities context) { var outParameter = new ObjectParameter("OUT_ID_POST", typeof(decimal)); int ret = context.SP_INSERT_POST(TITLE, CONTENT, ID_USER, outParameter); if (outParameter.Value == DBNull.Value) { throw new CreateRecordException(); } ID_POST = (Decimal)outParameter.Value; context.Entry(this).State = EntityState.Unchanged; return(ID_POST); }