示例#1
0
        public virtual async Task <NotificationResult> InsertAsync(InsertShoplistCommand command)
        {
            BeginTransaction();
            var result = await _handler.InsertAsync(command);

            return(Commit(result));
        }
示例#2
0
        public virtual async Task <NotificationResult> InsertAsync(InsertShoplistCommand command)
        {
            var result = new NotificationResult();
            var item   = new ShoplistInfo(command);

            result.Add(item.GetNotificationResult());
            if (!result.IsValid)
            {
                return(result);
            }
            result.Add(await _shoplistRepository.InsertAsync(item));
            if (result.IsValid)
            {
                result.Data = item.Id;
                result.AddMessage(Shared.Domain.Resources.Handler.InsertSuccess_Message);
            }
            else
            {
                result.AddErrorOnTop(Shared.Domain.Resources.Handler.InsertError_Message);
            }
            return(result);
        }
示例#3
0
 public ShoplistInfo(InsertShoplistCommand command)
 {
     Map(command);
     InitCollections();
     this.InsertOrUpdateScopeValidate();
 }