public bool Save(tInvoice entity) { // hard coded value for possibility of authoriazation module entity.Customer = null; entity.UserId = 1; if (entity.Id > 0) { return(invoiceRepo.Update(entity)); } return(invoiceRepo.Insert(entity)); }