/// <summary>
 ///     Delete a entity
 /// </summary>
 /// <param name="manager"></param>
 /// <param name="entity"></param>
 /// <returns></returns>
 public static ValidatorResult Delete <TEntity, TKey>(this IEntityManager <TEntity, TKey> manager, TEntity entity)
     where TKey : IEquatable <TKey>
     where TEntity : class, IEntity <TKey>
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     return(AsyncHelper.RunSync(() => manager.DeleteAsync(entity)));
 }
Пример #2
0
        public async Task <ICommandResult <Doc> > DeleteAsync(Doc model)
        {
            var result = await _entityManager.DeleteAsync(model);

            if (result.Succeeded)
            {
                // Expire simple entity cache for docs
                _simpleEntityStore.CancelTokens(null);
            }

            return(result);
        }
Пример #3
0
 public async Task <ICommandResult <Article> > DeleteAsync(Article model)
 {
     return(await _entityManager.DeleteAsync(model));
 }
Пример #4
0
 public async Task <ICommandResult <Question> > DeleteAsync(Question model)
 {
     return(await _entityManager.DeleteAsync(model));
 }
Пример #5
0
 public async Task <ICommandResult <Idea> > DeleteAsync(Idea model)
 {
     return(await _entityManager.DeleteAsync(model));
 }
Пример #6
0
 public async Task <ICommandResult <Topic> > DeleteAsync(Topic model)
 {
     return(await _entityManager.DeleteAsync(model));
 }