title: Entity Framework select sum specific column child table that have many to many relation and is not numeric
body: <p>I have this class</p>
  
  <pre><code>        using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.ComponentModel.DataAnnotations;
  
      namespace IVF_EHR.Models
      {
          public class SemenProcess
          {
              public Guid SemenProcessID { get; set; }
  
              public virtual List&lt;CollectionMethod&gt; CollectionMethods { get; set; }
  
              public SemenProcess()
              {
                  SemenProcessID = Guid.NewGuid();
                  CollectionMethods = new List&lt;CollectionMethod&gt;();
              }
  
          }
      }
  </code></pre>
  
  <p>as you see this class have relation width this class</p>
  
  <pre><code>            using System;
      using System.Collections.Generic;
      using System.Linq;
      using System.Web;
      using System.ComponentModel.DataAnnotations;
      using System.ComponentModel.DataAnnotations.Schema;
      using DevExpress.Web.ASPxEditors;
  
      namespace IVF_EHR.Models
      {
          public class CollectionMethod
          {
  
              [Key]
              public int CollectionMethodID { get; set; }
              [Required]
              [MaxLength(50)]
              public string Title { get; set; }
  
              public virtual List&lt;SemenProcess&gt; SemenProcesss { get; set; }
  
              public CollectionMethod()
              {
                  CollectionMethodID = 0;
                  Title = "";
                  SemenProcesss = new List&lt;SemenProcess&gt;();
              }
  
          }
      }
  </code></pre>
  
  <p>The relation between this 2 class is many to many.
  i need to write a one linq query with good performance that doing this</p>
  
  <pre><code>select dbo.GetWokeTitle(s.SemenProcessID)[woleTitle] , * from [SemenProcesses] [s] 
  </code></pre>
  
  <p>and <code>dbo.GetWokeTitle</code> is like this</p>
  
  <pre><code>    CREATE FUNCTION GetWokeTitle
      (
          @SemenProcessID uniqueidentifier 
      )
      RETURNS nvarchar(max)
      AS
      BEGIN
          declare @result nvarchar(max)
  
          set @result = '';
          select @result = @result + title  from [SemenProcessCollectionMethods] [sc] inner join [CollectionMethods] [c] on c.[CollectionMethodID]=sc.[CollectionMethod_CollectionMethodID]
          where sc.SemenProcess_SemenProcessID=@SemenProcessID
  
          -- Return the result of the function
          RETURN @result
  
      END
      GO
  </code></pre>
  
  <p>I use ADO.NET Entity Framework, and I need to write a linq query that does the same as the above SQL code.
  and one more thing 
  i cant execute .ToList() for performance issues , i need to produce one query Without execute that query . Actually i have a control that control use query not object list and that control execute query by itself .
  i can create view and use that view in entity but i want some thing else , that is may last way</p>