title: Entity Framework function returning an int instead of a List
body: <p>I have added a function in Entity Framework and I am trying to understand why it wants to return an <code>int</code> instead of a <code>List&lt;string&gt;</code>. </p>
  
  <p>I added the function to entity framework without an issue and once added and Validated the Context file looked as below:</p>
  
  <pre><code>public partial class Entities : DbContext
  {
      public Entities()
          : base("name=Entities")
      {
      }
  
      protected override void OnModelCreating(DbModelBuilder modelBuilder)
      {
          throw new UnintentionalCodeFirstException();
      }
  
      public DbSet&lt;AppName&gt; AppNames { get; set; }
      public DbSet&lt;AppStatus&gt; AppStatus { get; set; }
      public DbSet&lt;Audit&gt; Audits { get; set; }
      public DbSet&lt;EntryLog&gt; EntryLogs { get; set; }
      public DbSet&lt;LogType&gt; LogTypes { get; set; }
      public DbSet&lt;ModuleName&gt; ModuleNames { get; set; }
      public DbSet&lt;Trace&gt; Traces { get; set; }
      public DbSet&lt;Error&gt; Errors { get; set; }
  
      public virtual int GET_ALL_APPS()
      {
          return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GET_ALL_APPS");
      }
  }
  </code></pre>
  
  <p>I am calling the function below :</p>
  
  <pre><code>public List&lt;string&gt; GetApplicationNames()
      {
          using (ComData.Entities db = new ComData.Entities())
          {
              return db.GET_ALL_APPS();                 
          }
      }
  </code></pre>
  
  <p>and here is the function that I added:</p>
  
  <pre><code>create or replace FUNCTION GET_ALL_APPS RETURN SYS_REFCURSOR
    AS 
      PO_RESULT SYS_REFCURSOR;
    BEGIN
      OPEN PO_RESULT FOR
          SELECT UNIQUE 
            APP_NAME
          FROM 
            LG_ENTRY_BASE_LOG;
        RETURN PO_RESULT;
      END;
  </code></pre>
  
  <p>Does anyone know why Entity Framework would look for an <code>int</code> to come back instead of a <code>List&lt;string&gt;</code></p>
  
  <p>EDIT: The solution mentioned in the possible duplicate does not work because it involves T-SQL. This is PL/SQL and there is no equivalent to <code>SET NOCOUNT ON</code>when used in a function.</p>