jeudi 7 mai 2015

How to generate Autopoco data when object has protected contructor

Im getting an "No parameterless constructor defined for this object" exception when trying to generate data for the following object:

public class User  
{
    protected User();
    public User(string userName, string password);
}

this is the line that throws the error:

// Get 10 users
var users = pocoSession.List<User>(10).Get();

Aucun commentaire:

Enregistrer un commentaire