I'd like to expose a class I've written in C# down to the javascript equivalent.
for example I have a class like:
// C# class to represent an Appriaser
public class Appraiser
{
public Appraiser(appraiserId, appraiserName)
{
AppraiserId = appraiserId;
AppraiserName = appraiserName;
}
public int AppraiserId { get; set; }
public string AppraiserName { get; set; }
}
and I would like the ability to automatically generate a version of this class in javascript
// javascript class to represent an Appraiser
function Appraiser(appraiserId, appraiserName) {
var self = this;
self.appraiserid= appraiserId;
self.appraisername= appraisername;
}
Is this possible with JSON.NET or another method?