示例#1
0
        public async Task AddBuildOrder(int userId, User.UserBuildOrder buildOrder)
        {
            var user = await _context.Users
                       .Include(x => x.UserBuildOrders)
                       .SingleAsync(x => x.Id == userId);

            user.UserBuildOrders.Add(buildOrder);
            await _context.SaveChangesAsync();
        }
示例#2
0
        public async Task AddBuildOrder(int userId, BuildOrderParams orderParams)
        {
            var build = await _pcPartsRepository.GetBuildByIdAsync(orderParams.BuildId);

            var userBuildOrder = new User.UserBuildOrder
            {
                UserId  = userId,
                BuildId = build.Id,
                Price   = build.Price,
            };
            await _userRepository.AddBuildOrder(userId, userBuildOrder);
        }
示例#3
0
 public Task AddBuildOrder(int userId, User.UserBuildOrder buildOrder)
 {
     throw new System.NotImplementedException();
 }