DynamicModel.CopyFrom(DynamicModel dynamicModel) Method
.NET Standard 2.x
Copies data from another DynamicModel
object to the current DynamicModel
object.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Syntax
public void CopyFrom(DynamicModel dynamicModel)
Parameters
dynamicModel
SnapObjects.Data.DynamicModel
The DynamicModel
object from which to copy data.
Examples
The following code example copies data from the specified DynamicModel
object.
using SnapObjects.Data;
namespace Appeon.ApiDoc.DynamicModelExamples
{
public class CopyFromExample
{
private readonly SchoolContext _context;
public CopyFromExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example1()
{
string sql;
sql = "select courseid,title from Course";
DynamicModel dModel = _context.SqlExecutor.SelectOne<DynamicModel>(sql);
var fromModel = _context.SqlExecutor.Select<DynamicModel>(sql);
fromModel[0].CopyFrom(fromModel[1]);
}
}
}
Applies to
.NET Standard
2.x