public Shirt() { Random rnd = new Random(); int color1 = rnd.Next(0, 256); int color2 = rnd.Next(0, 256); int color3 = rnd.Next(0, 256); Size = rnd.Next(0, 51); Gender = Convert.ToBoolean(rnd.Next(0, 2)); Color = "(" + color1 + ", " + color2 + ", " + color3 + ")"; Neck = (NeckType)rnd.Next(0, 2); }
public async Task <int> SaveNeckType(NeckType neckType) { if (neckType.Id != 0) { _context.NeckTypes.Update(neckType); await _context.SaveChangesAsync(); return(1); } else { await _context.NeckTypes.AddAsync(neckType); await _context.SaveChangesAsync(); return(1); } }