ILoadable.ToArray Method
.NET Standard 2.x
Converts the result set to an array.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
TModel[] ToArray();
Returns
TModel[]
An array that contains all of the data of the result set.
Examples
The following code example demonstrates how to get an array of students.
using Appeon.ApiDoc.Models.School;
namespace Appeon.ApiDoc.ILoadableExamples
{
public class ToArrayExample
{
private SchoolContext _context;
public ToArrayExample(SchoolContext dataContext)
{
// Sets the data context.
_context = dataContext;
}
public void Example()
{
var loadable = _context.SqlModelMapper.Load<Student>();
// Creates a Student[] array that includes the data of the
// result set.
var students = loadable.ToArray();
}
}
}
Example Refer To
Model Class: Student
Applies to
.NET Standard
2.x