<p>I am writing a small program.  The interface I am writing to control each repository that is made defines a method of Save(IPublicObject).  I am using LINQ for the SQL Version of the repository CRUD.  My question is this.  I would like to have only the one method which accepts the interface type.  I want to think how I can best locate the Save action for the inherited type I then pass in.  </p>

<p>In the book I am reading Patterns of Enterprise Application Architecture.  I am leaning on the Inheritance Maping.  So I create a derived object of </p>

<pre><code>public class ConcretePublicObjectOne : IPublicObject{}
</code></pre>

<p>I want to then pass this into the Save Function of the respository.  It is at this point where I am trying to think how best to say, ok we need to use "WHAT?" Save Method etc...</p>

<p>Should I use a registry, configuration setting mapping the types?</p>

What you wish to do is to have a:
```
```
Repository.Save(publicObject)
```
```
and the repository to call a method from publicObject?
If this is the requirement then you can define the Save method in repository as:
```
```
public class Repository {
    public void Save(IPublicObject publicObject) {
        publicObject.Save();
    }
}
```
```
where IPublicObject is defined as:
```
```
public interface IPublicObject {
    void Save();
}
```
```
But with this approach you will have to define a save method for each entity (like ConcretePublicObjectOne in your example)