I am using asp.net MVC2.
I have a model defined as
public class Department
{
[ScaffoldColumn(false)]
public object Id { get; set; }
[Required(ErrorMessage = "Department Name is required")]
[StringLength(25)]
[DisplayName("Department Name")]
public string Name { get; set; }
[DefaultValue(true)]
[DisplayName("Active?")]
public bool Active { get; set; }
}
How to update an existing department document through my controller? my edit action is defined as
[HttpPost]
public ActionResult Edit(string id, Department department)
{
..
}
answer stated here tells there is a PATCH
command to update a document.
But i didn't find this in IDocumentSession
class in Raven's Client API
I do not want to first get the document and then update it like the way it is done in RavenDB's MVCMusicStore example
var albumModel = session.Load<Album>(id);
//Save Album
UpdateModel(albumModel, "Album");
session.SaveChanges();