public Salon Create(SalonModel model)
        {
            _logger.LogInformation("Create new Salon entity");
            Salon salon = new Salon
            {
                Name        = model.SalonName,
                Address     = model.SalonAddress,
                PhoneNumber = model.SalonPhoneNumber
            };

            _context.Add(salon);
            return(salon);
        }
        public Client Create(ClientModel model)
        {
            var client = new Client
            {
                FirstName   = model.ClientFirstName,
                LastName    = model.ClientLastName,
                Email       = model.ClientEmail,
                PhoneNumber = model.ClientPhoneNumber
            };

            _context.Add(client);
            _context.SaveChanges();
            // ay stegh save changesic heto cliente kstana ira Idin, vorov hetev SaveChangese gruma baza u stanuma clienti IDn

            return(client);
        }
Beispiel #3
0
 public void Add <T>(T entity) where T : class
 {
     _logger.LogInformation($"Adding an object of type {entity.GetType()} to the context");
     _context.Add(entity);
 }