views:

23

answers:

1

I have a class "Artikel" and there i write some Business Logic. I also have a class "tArtikel" which is a type. In my class "Artikel" I work with "tArtikel" and returns are of that type. Now when i instantiate an "Artikel" i want it to be of type "tArtikel", so what i tried in my code is:

      public tArtikel Artikel()
      {
        tArtikel artikel = new tArtikel();
      }

Which results in: "'Artikel' member names cannot be the same as their enclosing type".

How would i set this up correctly?

+2  A: 

Since the class name is Artikel the only functions that can be named Artikel are constructors which in turn don't have a return type.

public Artikel()
{
}
Itay
I know, my question was probably just malformed and what I want is impossible and not properly figured out before asking.
Younes