happysmile
happysmile

Reputation: 7777

error method must have an return type

This is my class file I am getting an error as "method must have an return type"

public class Users 
{
  public string FirstName { get; set; }
  public string LastName { get; set; }
}
public class UsersList : List<Users>
{
  public UsersList 
 {
   this.Add(new Users() { FirstName = "John", LastName = "Lock"}); 
   this.Add(new Users() { FirstName = "James", LastName = "Soyer"}); 
   this.Add(new Users() { FirstName = "Jack", LastName = "Sephered"}); 
 }
}

I am trying to Binding to a Static Resource of a Collection of Custom Instances

Upvotes: 0

Views: 1378

Answers (1)

GregC
GregC

Reputation: 7977

...

public UsersList()
{
    ...
}

Upvotes: 4

Related Questions