简体   繁体   中英

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

...

public UsersList()
{
    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM