Skip to content

DataSource

A DataSource is an abstraction used by the module to provide all required data to be seeded.

Note

It is recommended to implement the DataSource<T> base class instead of the interface itself.

The implemented DataSource must assign the EntryIds property (preferably in the class constructor) and implement/override the Provide method, which should return the list of entries to be seeded.

C#
public class MyDataSource : DataSource<T>
{
    public MyDataSource()
    {
        this.EntryIds = // assign ids from the required entries to be seeded.
    }

    public override IEnumerable<UxRole> Provide()
    {
        // return the entries to be seeded here.
    }
}