public Cost VObject(Cost cost, ICostService _costService) { Cost oldcost = _costService.GetObjectById(cost.Id); if (oldcost == null) { cost.Errors.Add("Generic", "Invalid Data For Update"); } else if (!VOffice(cost.OfficeId, oldcost.OfficeId)) { cost.Errors.Add("Generic", "Invalid Data For Update"); } return(cost); }