public virtual async Task <NotificationResult> InsertAsync(InsertShoplistCommand command) { BeginTransaction(); var result = await _handler.InsertAsync(command); return(Commit(result)); }
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); }
public ShoplistInfo(InsertShoplistCommand command) { Map(command); InitCollections(); this.InsertOrUpdateScopeValidate(); }