c# - How to create an Generic Interface with two methods with the same name but different signature? -
i receive error when trying create generic interface have 2 method same name different signature. idea doing wrong , how fix it?
type 'xxx.interfaces.irepository' defines member called 'delete' same parameter types
public interface irepository<t> : irepositoryreadonly<t> { void add(t entity); void update(t entity); void delete(t id); void delete(t entity); void save(); }
your methods don't have different signatures. names of method-parameters not matter, type.
how going specify in calling code method want call?
is id
of type t
, or should of type int
?
public interface irepository<t> : irepositoryreadonly<t> { void add(t entity); void update(t entity); void delete(int id); void delete(t entity); void save(); }
Comments
Post a Comment