I use Linq for Sql (although this is equally applicable in the Entity Framework) for my models, and I always find that I create friend classes for my models. I find it a lot of time and many times. Is there an easy way to automatically generate these friend classes based on models? Perhaps a visual studio macro?
An example of the buddy class that I would like to create:
[MetadataType(typeof(PersonMetadata))]
public partial class Person
{
}
public class PersonMetadata
{
public object Id { get; set; }
public object FirstName { get; set; }
}
Thanks in advance.
source
share