Пример #1
0
        public BasketViewModel Create()
        {
            var userToken = _guidWrapper.NewGuid();
            var basketId  = _basketStore.Create(userToken);

            return(new BasketViewModel
            {
                BasketId = basketId,
                Token = userToken
            });
        }
Пример #2
0
        /// <inheritdoc />
        public async Task <User> CreateAsync(User user)
        {
            // TODO: do validation here using fluent validation

            user.Id           = _guidWrapper.NewGuid();
            user.RegisteredOn = _dateTimeWrapper.UtcNow();

            await _userStore.CreateAsync(user);

            return(await _userQuery.GetAsync(user.Id.Value));
        }
Пример #3
0
        private void SetDefaultParameters(User user)
        {
            var now = _dateTimeWrapper.UtcNow();

            user.Id           = _guidWrapper.NewGuid();
            user.RegisteredOn = now;

            if (user.Notes != null && user.Notes.Any())
            {
                user.Notes.ForEach(n =>
                {
                    n.CreatedOn  = now;
                    n.ModifiedOn = now;
                });
            }
        }
 public LocalPathProviderBuilder WithGuid(Guid guid)
 {
     _guidMock.NewGuid().Returns(guid);
     return(this);
 }
Пример #5
0
        public string BuildPath(string fileName)
        {
            var fileExtension = _pathWrapper.GetExtension(fileName).Replace(".", "");
            var fullPath      = _pathWrapper.Combine(_appEnvironmentPath, fileExtension, _guidWrapper.NewGuid().ToString() + fileName);

            return(fullPath);
        }