Skip to content

Instantly share code, notes, and snippets.

Created Oct 30, 2018
What would you like to do?
Rename inherited member in Sub class
using System.Linq;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.Text;
public class Parent
[DataMember(Name = "parentItem")]
public virtual string Item { get; set; }
public class Child : Parent
[DataMember(Name = "childItem")]
public override string Item { get; set; }
var json1 = new Parent { Item = "parent" }.ToJson();
var json2 = new Child { Item = "child" }.ToJson();
<?xml version="1.0" encoding="utf-8"?>
<package id="ServiceStack.Text" version="5.2.0" targetFramework="net45" />
<package id="ServiceStack.Client" version="5.2.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.2.0" targetFramework="net45" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment