Skip to content

Instantly share code, notes, and snippets.

@VagyokC4
Last active April 15, 2019 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VagyokC4/4290ea8a4dcac27e88689d3f6fea8d90 to your computer and use it in GitHub Desktop.
Save VagyokC4/4290ea8a4dcac27e88689d3f6fea8d90 to your computer and use it in GitHub Desktop.
ConvertTo Example
using System;
using ServiceStack;
using ServiceStack.Text;
public class Parent
{
}
public class Child : Parent
{
}
var child = new Child();
var parent = child.ConvertTo<Parent>();
Console.WriteLine("Convert Child To Parent => " + parent.GetType().Name);
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ServiceStack.Text" version="5.0.0" targetFramework="net45" />
<package id="ServiceStack.Client" version="5.0.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.0.0" targetFramework="net45" />
</packages>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment