本文整理汇总了C#中Models.ToJson方法的典型用法代码示例。如果您正苦于以下问题:C# Models.ToJson方法的具体用法?C# Models.ToJson怎么用?C# Models.ToJson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.ToJson方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTask
public static Models.Task CreateTask( this Asana asana, Models.TaskData taskToCreate, string workspaceID = "" )
{
var path = ( workspaceID.Length != 0 ? string.Format( "workspaces/{0}/tasks", workspaceID ) : "tasks" );
return new JavaScriptSerializer().Deserialize<Models.Task>( Http.Post( path, asana.ApiKey, taskToCreate.ToJson() ) );
}
示例2: UpdateTask
public static Models.Task UpdateTask( this Asana asana, Models.TaskData newTaskInfo, string taskID )
{
return Http.Put( string.Format( "tasks/{0}", taskID ), asana.ApiKey, newTaskInfo.ToJson() ).FromJson<Models.Task>();
}
示例3: UpdateProject
public static Models.Project UpdateProject( this Asana asana, string projctID, Models.ProjectData newProjectData )
{
return Http.Put( string.Format( "projects/{0}", projctID ), asana.ApiKey, newProjectData.ToJson() ).FromJson<Models.Project>();
}
示例4: UpdateWorkspace
public static Models.Workspaces UpdateWorkspace( this Asana asana, Models.WorkspaceData newWorkspaceData )
{
return Http.Put( "workspaces", asana.ApiKey, newWorkspaceData.ToJson() ).FromJson<Models.Workspaces>();
}
示例5: CreateProject
public static Models.Project CreateProject( this Asana asana, Models.ProjectData newProject, string workspaceID = "" )
{
var path = ( workspaceID.Length != 0 ? string.Format( "workspaces/{0}/projects", workspaceID ) : "projects" );
return Http.Post( path, asana.ApiKey, newProject.ToJson() ).FromJson<Models.Project>();
}
示例6: UpdateTag
public static Models.Tag UpdateTag( this Asana asana, Models.TagData newTagData, string tagID )
{
return Http.Put( string.Format( "tags/{0}", tagID ), asana.ApiKey, newTagData.ToJson() ).FromJson<Models.Tag>();
}
示例7: CreateTag
public static Models.Tag CreateTag( this Asana asana, Models.TagData newTag, string workspaceID = "" )
{
var path = ( workspaceID.Length != 0 ? string.Format( "workspaces/{0}/tags", workspaceID ) : "tags" );
return Http.Post( path, asana.ApiKey, newTag.ToJson() ).FromJson<Models.Tag>();
}
示例8: Update
public void Update(Models.TextContent @new, Models.TextContent old)
{
//if (@new["_id"] == null && old["_id"] != null)
//{
// @new["_id"] = old["_id"];
//}
@new.StoreFiles();
((IPersistable)@new).OnSaving();
var bucket = old.GetRepository().GetClient();
bucket.ExecuteStore(StoreMode.Replace, old.UUID, @new.ToJson(), PersistTo.One);
((IPersistable)@new).OnSaved();
}
示例9: Add
public void Add(Models.TextContent content)
{
content.StoreFiles();
((IPersistable)content).OnSaving();
var bucket = content.GetRepository().GetClient();
//bucket.Store(StoreMode.Set, "Schema." + content.UUID, content.ToJson());
bucket.ExecuteStore(StoreMode.Set, content.UUID, content.ToJson(), PersistTo.One);
((IPersistable)content).OnSaved();
}