public void UpdateTemplatedDocumentData(TemplatedDocumentData data) { using (var db = new LogistoDb()) { //db.TemplatedDocumentData.Where(w => w.ID == data.ID) //.Set(u => u.Data, data.Data) //.Update(); File.WriteAllBytes(TEMPLATED_DOCUMENTS_ROOT + data.ID, data.Data); } }
public int CreateTemplatedDocumentData(TemplatedDocumentData data) { using (var db = new LogistoDb()) { var id = Convert.ToInt32(db.InsertWithIdentity(data)); if (data.Data != null) { File.WriteAllBytes(TEMPLATED_DOCUMENTS_ROOT + id, data.Data); } return(id); } }