Creating a Generic Save() Method for Models
问题 I have a fairly simple system, and for the purposes of this question there are essentially three parts: Models, Repositories, Application Code. At the core are the models. Let's use a simple contrived example: public class Person { public string FirstName { get; set; } public string LastName { get; set; } } In that same project is a generic repository interface. At its simplest: public interface IRepository<T> { T Save(T model); } Implementations of that interface are in a separate project