E-mail
While trying to figure out what is meant by the 3rd new section in a view in MVC
<%: Html.ActionLink("Edit", "Edit", new { id=item.DinnerID }) %>
So it is really creating an object with a single property id, which is an int, equal to that of the item, which is a Dinner.
“Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having to first explicitly define a type”
class Program { static void Main(string[] args) { // Anonymous types provide a convenient way to encapsulate a set of read-only properties // into a single object without having to first explicitly define a type var person = new { Name = "Terry", Age = 21 }; Console.WriteLine("name is " + person.Name); Console.WriteLine("age is " + person.Age.ToString()); // Anonymous types just get rid of Person1 really. Person1 person1 = new Person1 { Name = "Bill", Age = 55 }; Console.WriteLine("name is " + person1.Name); Console.WriteLine("age is " + person1.Age.ToString()); } } class Person1 { public string Name { get; set; } public int Age { get; set; } }
Remember Me
a@href@title, strike