Has anyone had experience with Razor without MVC. I am using a Template engine build up from http://www.fidelitydesign.net/?p=208 but I cannot use any of the linq queries within the Razor code for example
<div>
@Model.Person.First().Firstname
</div>
This throws the error:
System.Collections.Generic.List' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'System.Collections.Generic.List' could be found (are you missing a using directive or an assembly reference
For this example Model contains a List of Person below
public class Person
{
public string FirstName { get; set; }
}
@using System.Linq?Modelis the list, soFirstneeds to be called onModel.<system.web><compilation><assemblies><add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>Don't forget to restart Visual Studio :)