title: Only initializers, entity members, and entity navigation properties are supported. (ASP.NET MVC and Entity Framework)
body: <p>I am stuck in somewhere on my ASP.NET MVC 3 app. here is the error I am getting : </p>
  
  <blockquote>
    <p>The specified type member 'AccommPropertyTags' is not supported in
    LINQ to Entities. Only initializers, entity members, and entity
    navigation properties are supported.</p>
  </blockquote>
  
  <p>I have found how we can solve this on following article : </p>
  
  <p><a href="https://stackoverflow.com/questions/6919709/only-initializers-entity-members-and-entity-navigation-properties-are-supported">Only initializers, entity members, and entity navigation properties are supported</a></p>
  
  <p>But mine is a little bit odd.</p>
  
  <p>Here is one of the partial class of my entity : </p>
  
  <pre><code>[MetadataType(typeof(AccommPropertyWebDetail.MetaData))]
  public partial class AccommPropertyWebDetail {
  
      public virtual ICollection&lt;string&gt; AccommPropertyTags {
  
          get {
  
              return Helpers.AccommPropertyTag.CreateStringListFromString(this.PropertyTags);
          }
      }
  
      private class MetaData {
  
          [Required, StringLength(50)]
          public string Category { get; set; }
  
      }
  }
  </code></pre>
  
  <p>As you can see above, <code>AccommPropertyTags</code> property is typeof <code>ICollection&lt;string&gt;</code>. What I am trying inside my controller is as follows : </p>
  
  <pre><code>public ViewResult Tag(string tag) {
  
      var _rawTag = HttpUtility.UrlDecode(tag);
  
      ViewBag.Tag = _rawTag;
  
      var model = _accommpropertyrepo.GetAllAccommPropertiesFullWebIgnoringApprovalStatus();
  
      model = model.Where(
              x =&gt; x.AccommPropertyTags.Any(
                      y =&gt; y == _rawTag
                  )
          );
  
      return View(model);
  }
  </code></pre>
  
  <p>Because of the fact that I am using <code>Any</code> there, Entity is trying to convert my <code>AccommPropertyTags</code> property to SQL and cant because it's not part of the table schema.</p>
  
  <p>Am I really stuck here or is there a cool way of beating this annoying error?</p>