public async Task InsertOrUpdateAsync(Cms cms) { if (cms.Id == 0) { await _cmsRepository.InsertAsync(cms); } else { await _cmsRepository.UpdateAsync(cms); } }
public static Cms InsertOrUpdateCMSContent(int tenantId, int id, string pageName, string pageContent) { var cms = new Cms { TenantId = tenantId, Id = id, PageName = pageName, PageContent = pageContent }; cms.ValidateId(cms.Id); cms.ValidatePageNameLength(cms.PageName); cms.ValidatePageContentLength(cms.PageContent); return(cms); }