/// <summary> /// Adds the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <returns>A Task.</returns> public Task Add(Task entity) { using (var con = this._connection.Create()) { con.Open(); var id = con.Insert(entity); return this.Get(id); } }
/// <summary> /// Adds the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <returns>A Task.</returns> public Task Add(Task entity) { using (var docstore = this._documentStore.Create()) { using (IDocumentSession session = docstore.OpenSession()) { session.Store(entity); session.SaveChanges(); } } return entity; }
/// <summary> /// Updates the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <returns>A Task.</returns> public Task Update(Task entity) { using (var con = this._connection.Create()) { con.Open(); con.Update(entity); return this.Get(entity.TaskId); } }
/// <summary> /// Updates the specified entity. /// </summary> /// <param name="entity">The entity.</param> /// <returns>A Task.</returns> public Task Update(Task entity) { throw new NotImplementedException(); }