DynamicModel.Properties Property
.NET Standard 2.x
Gets an IReadOnlyList<IPropertyInfo>
object which contains information about all of the properties used in the current DynamicModel
object.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public IReadOnlyList<IPropertyInfo> Properties
Property Value
System.Collections.Generic.IReadOnlyList<IPropertyInfo>
An IReadOnlyList<IPropertyInfo>
object which contains information about all of the properties used in the current DynamicModel
object.
Examples
The following code example gets all of the properties of the DynamicModel
object and then returns the number of properties.
using SnapObjects.Data;
using System;
namespace Appeon.ApiDoc.DynamicModelExamples
{
public class PropertiesExample
{
private readonly SchoolContext _context;
public PropertiesExample(SchoolContext dataContext)
{
// Sets the data context.
_context = dataContext;
}
public void Example()
{
string sql;
sql = "select CourseID, Title from Course";
DynamicModel dynamicModel =
_context.SqlExecutor.SelectOne<DynamicModel>(sql);
// Gets all of the properties of DynamicModel
var count = dynamicModel.Properties;
// Shows the number of properties in DynamicModel
Console.WriteLine("Property Count = {0}", count.Count);
/*This code produces the following output:
Property Count = 2
*/
}
}
}
Applies to
.NET Standard
2.x