Esempio n. 1
0
        public int Create(Company company)
        {
            var newCompany = ModelMapperService.MapToModel(company);

            _context.Companies.Add(newCompany);
            _context.SaveChanges();

            if (newCompany.Id == null)
            {
                throw new Exception("User creation exception.");
            }

            return(newCompany.Id ?? 0);
        }
 public void Create(Stack stack)
 {
     _context.Stack.Add(ModelMapperService.MapToModel(stack));
     _context.SaveChanges();
 }
 public void Create(Address address)
 {
     _context.Address.Add(ModelMapperService.MapToModel(address));
     _context.SaveChanges();
 }