public BasketViewModel Create() { var userToken = _guidWrapper.NewGuid(); var basketId = _basketStore.Create(userToken); return(new BasketViewModel { BasketId = basketId, Token = userToken }); }
/// <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)); }
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); }
public string BuildPath(string fileName) { var fileExtension = _pathWrapper.GetExtension(fileName).Replace(".", ""); var fullPath = _pathWrapper.Combine(_appEnvironmentPath, fileExtension, _guidWrapper.NewGuid().ToString() + fileName); return(fullPath); }