public Template SaveOrUpdate(Template template) { if (template.Id == default(int)) { if (template.CreateBy == default(Guid)) { template.CreateBy = SecurityContext.CurrentAccount.ID; } if (template.CreateOn == default(DateTime)) { template.CreateOn = TenantUtil.DateTimeNow(); } } template.LastModifiedBy = SecurityContext.CurrentAccount.ID; template.LastModifiedOn = TenantUtil.DateTimeNow(); return(_dao.Save(template)); }