Beispiel #1
0
        protected virtual async Task <Store> UpdateStoreAsync(CreateOrUpdateStoreInput input)
        {
            var store = ObjectMapper.Map <Store>(input);
            await _storeManager.UpdateAsync(store);

            return(store);
        }
Beispiel #2
0
        public async Task <EntityDto <long> > CreateOrUpdateStore(CreateOrUpdateStoreInput input)
        {
            Store store;

            if (input.Id.HasValue && input.Id.Value > 0)
            {
                store = await UpdateStoreAsync(input);
            }
            else
            {
                store = await CreateStoreAsync(input);
            }

            await CurrentUnitOfWork.SaveChangesAsync();

            return(new EntityDto <long> {
                Id = store.Id
            });
        }