Last active
August 29, 2015 13:57
-
-
Save cerkit/9748270 to your computer and use it in GitHub Desktop.
The base Entity class for my portable class library.
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 Newtonsoft.Json; | |
using System.IO; | |
namespace RecordKeeper.Portable.Models | |
{ | |
public abstract class EntityBase | |
{ | |
public EntityBase() { } | |
#region Properties | |
public string Id { get; set; } | |
public string Description { get; set; } | |
#endregion | |
#region Utility Methods | |
public string ToJson() | |
{ | |
StringWriter w = new StringWriter(); | |
JsonSerializer s = new JsonSerializer(); | |
s.Serialize(new JsonTextWriter(w), this); | |
return w.ToString(); | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment