I'm trying to use a dictionary in c# as follows
and seems to be the declaration and initialization are ok .
Then I create an instance of
where Orderstore implements the IStorage and Order implements IEntity.
But when I try to add Orderstore to the dictionary it says "Argument type Orderstore is not assignable to parameter type IStorage"
I wonder anyone can help me with this. Thanks in advance.
Edited 15-Jan-13 23:18pm
Use the code given below:
If myOrders is the name of the dictionary, then use
Orderstore order = myOrders[index] as Orderstore;
TypeCast it "as OrderSto0re" then your code will work.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)