public void Create(CompaniesVM company) { _context.Company.Add(new Company { Name = company.Name, Country = company.Country, City = company.City, Street = company.Street, ZipCode = company.ZipCode }); _context.SaveChangesAsync(); }
public void Update(CompaniesVM company) { var data = _context.Company.FirstOrDefault(x => x.Id == company.Id); if (data != null) { data.Name = company.Name; data.Country = company.Country; data.City = company.City; data.Street = company.Street; data.ZipCode = company.ZipCode; } _context.SaveChangesAsync(); }