public Vessel CreateObject(Vessel vessel) { vessel.Errors = new Dictionary <String, String>(); if (!isValid(_validator.VCreateObject(vessel, this))) { vessel.MasterCode = _repository.GetLastMasterCode(vessel.OfficeId) + 1; vessel = _repository.CreateObject(vessel); } return(vessel); }