public LandlordDTO(LandlordDTO copy) { Id = copy.Id; Forename = copy.Forename; Surname = copy.Surname; Email = copy.Email; Phone = copy.Phone; }
public void UpdateLandLord(LandlordDTO landLord) { var original = dataContext.Landlords.Single(ll => ll.LandlordId == landLord.Id); original.Forename = landLord.Forename; original.Surname = landLord.Surname; original.Email = landLord.Email; original.Phone = landLord.Phone; dataContext.SubmitChanges(); }
public int CreateLandLord(LandlordDTO dto) { if (dto is null) { return(0); } var landlord = new Landlord() { Forename = dto.Forename, Surname = dto.Surname, Email = dto.Email, Phone = dto.Phone }; dataContext.Landlords.InsertOnSubmit(landlord); dataContext.SubmitChanges(); return(landlord.LandlordId); }