Exemplo n.º 1
0
        public void Create(TripCreate model, string userId)
        {
            var entity = new Trip
            {
                Price     = model.Price,
                DateEnd   = model.DateEnd,
                Country   = model.Country,
                DateStart = model.DateStart,
                UserId    = userId
            };

            _dbContext.Trips.Add(entity);
            _dbContext.SaveChanges();
        }
Exemplo n.º 2
0
        public void Create(ArtistCreate model, string userId)
        {
            var entity = new Artist
            {
                Birthday  = model.Birthday,
                FirstName = model.FirstName,
                Country   = model.Country,
                LastName  = model.LastName,
                UserId    = userId
            };

            _dbContext.Artists.Add(entity);
            _dbContext.SaveChanges();
        }
Exemplo n.º 3
0
        public void Create(CarCreate model, string userId)
        {
            var entity = new Car
            {
                CarMakeId        = model.CarMakeId,
                CarModelId       = model.CarModelId,
                DateOfProduction = model.DateOfProduction,
                Price            = model.Price,
                Country          = model.Country,
                UserId           = userId
            };

            _dbContext.Cars.Add(entity);
            _dbContext.SaveChanges();
        }