Exemplo n.º 1
0
        /// <summary>
        /// Inserts the <see cref="ITaskPoco"/> asynchronous.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <returns>Task.</returns>
        public Task InsertTaskAsync(ITaskPoco model)
        {
            if (model.Id == Guid.Empty)
            {
                model.Id = Guid.NewGuid();
            }

            model.DateUpdated = DateTime.UtcNow;
            model.DateCreated = DateTime.UtcNow;

            return(taskRepository.InsertAsync(model));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds <see cref="ITaskPoco"/> model for delete. This will not call Save() method.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void AddForDelete(ITaskPoco model)
 {
     genericRepository.Delete(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Updates the <see cref="ITaskPoco"/> asynchronous.
 /// </summary>
 /// <param name="model">The model.</param>
 /// <returns>Task.</returns>
 public Task UpdateTaskAsync(ITaskPoco model)
 {
     return(taskRepository.UpdateAsync(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds <see cref="ITaskPoco"/> model for update. This will not call Save() method.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void AddForUpdate(ITaskPoco model)
 {
     genericRepository.Update(mapper.Map <DAL.Task>(model));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Adds <see cref="ITaskPoco"/> model for insert. This will not call Save() method.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void AddForInset(ITaskPoco model)
 {
     genericRepository.Insert(mapper.Map <DAL.Task>(model));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Deletes the specified <see cref="ITaskPoco"/> model asynchronous.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual System.Threading.Tasks.Task DeleteAsync(ITaskPoco model)
 {
     genericRepository.Delete(mapper.Map <DAL.Task>(model));
     return(genericRepository.SaveAsync());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Deletes the specified <see cref="ITaskPoco"/> model.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void Delete(ITaskPoco model)
 {
     genericRepository.Delete(mapper.Map <DAL.Task>(model));
     genericRepository.Save();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Inserts the specified <see cref="ITaskPoco"/> model into the database.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void Insert(ITaskPoco model)
 {
     genericRepository.Insert(mapper.Map <DAL.Task>(model));
     genericRepository.Save();
 }