Beispiel #1
0
        public async Task UpsertStore(StoreDto input)
        {
            try
            {
                var obj = input.MapTo <Store>();
                if (input.Id == 0)
                {
                    obj.IsDeleted    = false;
                    obj.CreatedBy    = AbpSession.UserId;
                    obj.DateCreated  = DateTime.Now;
                    obj.DateModified = null;
                }
                else
                {
                    obj.ModifiedBy   = AbpSession.UserId;
                    obj.DateModified = DateTime.Now;
                }

                await _storeRepository.InsertOrUpdateAsync(obj);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public StoreViewModel(StoreDto output)
 {
     output.MapTo(this);
 }