I'm using Devart's Linq to sql in my project (not Entity Framework). Try to select from database with Query<T>
, or ExecuteQuery<T>
, but T
deliberately don't have public parameterless constructor. Can I somehow overwrite how should a new instance of T
created? For example giving an instance of AutoMapper.Profile
at some point? Or giving a Func<T>
that will create the T
instance before it's overwritten with the value from the DB?
using( var DC = new SomeDevartDataContextBaseDerivative() )
{
// exception because parameterless constructor
var FM = DC.ExecuteQuery<SomeTypeWithoutParameterlessConstructor>( "Select 1 as Id" );
return FM;
}