Getting Started
This page will help you get started with ObjectFiller.NET. You'll be up and running in a jiffy!
First you need to add the ObjectFiller.NET package to your project using NuGet.
Do that by running the following command in the Package Manager Console:
Install-Package Tynamix.ObjectFiller
Now you can start using ObjectFiller.NET in your application.
public class Person
{
public string Name { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public DateTime Birthday { get; set; }
}
public class HelloFiller
{
public void CreatePerson()
{
Filler<Person> pFiller = new Filler<Person>();
Person p = pFiller.Create();
}
}
public class Person
{
public string Name { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public DateTime Birthday { get; set; }
}
public class HelloFiller
{
public void FillPerson()
{
Person person = new Person();
Filler<Person> pFiller = new Filler<Person>();
Person p = pFiller.Fill(person);
}
}
It is also possible to fill an already existing instance of an object. In the second example on the right side we first create a person and then call Fill(...) instead of Create(). This is great for stuff like DesignViewModels in WPF or whereever you need to fill the object in the constructor with Fill(this) for example.
Updated less than a minute ago