Last active
April 15, 2019 20:26
-
-
Save VagyokC4/4290ea8a4dcac27e88689d3f6fea8d90 to your computer and use it in GitHub Desktop.
ConvertTo Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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