Hi
Will it be possible to use ConvertTo between class and Interface like my code sample below ?
When I hit the line response.IUser = user.ConvertTo();
I get ServiceStack.WebServiceException : Cannot create an abstract class.
I know it’s better to use dto class for service…
I have another project that I would like to use ConvertTo method between class and interface.
[Authenticate]
public object Get(UserRequest request)
{
var response = new UserResponse();
Rei4DUsers user = Db.Single<Rei4DUsers>(u => u.Email == request.EmailOrLogin);
if (user is null)
{
user = Db.Single<Rei4DUsers>(u => u.Login == request.EmailOrLogin);
}
response.IUser = user.ConvertTo<IUser>();
user = response.IUser.ConvertTo<Rei4DUsers>();
return response;
}
Thanks
Andre