protected string GetProjectData(){IProjectService _service = StructureMap.ObjectFactory.GetInstance<IProjectService>();JavaScriptSerializer js = new JavaScriptSerializer();return js.Serialize(_service.Get());}[{"Id":1,"Client":"dfsf","Name":"dfsf","LeadDeveloper":"dfsf","ProjectManager":"dfsf",
"PercentComplete":23,"KickOffDate":"\/Date(1262325600000)\/",
"LaunchDate":"\/Date(1285909200000)\/","ModifiedDate":"\/Date(1265832196070)\/",
"ModifiedBy":"dfsf"}]
Search
just show me the code
Wednesday, August 4, 2010
JSON Serializer
dyanmic data partial class meta data
namespace DynamicData.Code.DataAccess.Sql.Dbml{[MetadataType(typeof(GameMetadata))]public partial class Game{}public class GameMetadata{public object HomeTeamId {get; set;}public object AwayTeamId { get; set; }[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]//[Range(0,100, ErrorMessage="enter a quanity between ")]public object Date { get; set; }public object Line { get; set; }public object HomeScore { get; set; }public object AwayScore { get; set; }public object WeekId { get; set; }}}
Subscribe to:
Posts (Atom)