Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Agent__00725-May-15 23:56
professionalAgent__00725-May-15 23:56 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Gyana_Ranjan Dash26-May-15 21:08
Gyana_Ranjan Dash26-May-15 21:08 
GeneralRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# Pin
Armugam Indrani28-May-15 22:48
professionalArmugam Indrani28-May-15 22:48 
AnswerRe: Difference Between Equality Operator ( ==) and .Equals() Method in C# PinPopular
harold aptroot26-May-15 1:02
harold aptroot26-May-15 1:02 
QuestionDataRelation problem Pin
Supratik De25-May-15 6:35
Supratik De25-May-15 6:35 
AnswerRe: DataRelation problem Pin
Richard Deeming27-May-15 1:19
mveRichard Deeming27-May-15 1:19 
QuestionInterface implementation strategies : four techniques; but: when (if) to use (which) one of them Pin
BillWoodruff25-May-15 4:06
professionalBillWoodruff25-May-15 4:06 
AnswerRe: Interface implementation strategies : four techniques; but: when (if) to use (which) one of them Pin
Richard Deeming27-May-15 1:29
mveRichard Deeming27-May-15 1:29 
I'd go with #2 - the fact that the class is using a Dictionary<TKey, TValue> to store the values is an implementation detail, which seems to be irrelevant to the consumer of the interface. All the consumer cares about is that your class has the AddEntry(string, int) and RemoveEntry(string) methods, so that's all that the interface should expose.

Depending on the intended use, it might be worth making the interface generic:
C#
public interface IRequire<TKey, TValue>
{
    void AddEntry(TKey key, TValue value);
    void RemoveEntry(TKey key);
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionToolstrip grey border Pin
Member 1171517124-May-15 6:52
Member 1171517124-May-15 6:52 
AnswerRe: Toolstrip grey border Pin
Ravi Bhavnani25-May-15 9:53
professionalRavi Bhavnani25-May-15 9:53 
QuestionReport From Date to Date Pin
abdo.kouta23-May-15 5:45
abdo.kouta23-May-15 5:45 
AnswerRe: Report From Date to Date Pin
OriginalGriff23-May-15 6:15
mveOriginalGriff23-May-15 6:15 
GeneralRe: Report From Date to Date Pin
abdo.kouta23-May-15 8:02
abdo.kouta23-May-15 8:02 
AnswerRe: Report From Date to Date Pin
Mycroft Holmes23-May-15 17:22
professionalMycroft Holmes23-May-15 17:22 
QuestionRe: Report From Date to Date Pin
abdo.kouta23-May-15 21:37
abdo.kouta23-May-15 21:37 
AnswerRe: Report From Date to Date Pin
Mycroft Holmes24-May-15 0:28
professionalMycroft Holmes24-May-15 0:28 
GeneralRe: Report From Date to Date Pin
abdo.kouta24-May-15 4:02
abdo.kouta24-May-15 4:02 
GeneralRe: Report From Date to Date Pin
Mycroft Holmes24-May-15 14:16
professionalMycroft Holmes24-May-15 14:16 
AnswerRe: Report From Date to Date Pin
jschell24-May-15 7:01
jschell24-May-15 7:01 
Questionasp.net with c# Pin
Member 1158609823-May-15 0:50
Member 1158609823-May-15 0:50 
AnswerRe: asp.net with c# Pin
Sascha Lefèvre23-May-15 1:18
professionalSascha Lefèvre23-May-15 1:18 
AnswerRe: asp.net with c# Pin
OriginalGriff23-May-15 2:05
mveOriginalGriff23-May-15 2:05 
QuestionEncypt a number to a 6 unique digits code Pin
Jassim Rahma22-May-15 13:04
Jassim Rahma22-May-15 13:04 
AnswerRe: Encypt a number to a 6 unique digits code Pin
Dave Kreskowiak22-May-15 14:38
mveDave Kreskowiak22-May-15 14:38 
AnswerRe: Encypt a number to a 6 unique digits code Pin
Sascha Lefèvre22-May-15 15:06
professionalSascha Lefèvre22-May-15 15:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.