generic-interface

Generic interfaces

Here is my code public interface ITranslator<E, R> { E ToEntity<T>(R record); } class Gens : ITranslator<string, int> { #region ITranslator<string,int> Members public string ToEntity<MyOtherClass>(int record) { return record.ToString(); } #endregion } When I compile this, I get an error Type p...

How to deal with private member accessor and collections?

I have a class hierachy like this public class A { protected class B { String Name { get; set; } } protected class C : KeyedCollection<String, B> { // ... } protected C Collection { get; } // ... public A Copy () { // Creates a deep copy of this instance. } } N...