I would like to be able to mark some of my generated POCOs with a marker interface that guarantees they implement a given property.
For example;
For example;
public interface IHasCode
{
string Code { get; }
}
// Generated:
public class Employee : IHasCode
{
public Guid Id { get; set; }
public string Code { get; set; }
}
There are a couple of ways I can think of:- Make all generated classes partial, so I can create another file for those I want to, and add the interface there.
- Have the generated code implement the interface for those POCOs that meet a certain criteria (regex wouldn't cut it - it'd have to be a Func<[class definition], bool> or something that allows me to inspect the properties and see if there's a column called "Code").