예제 #1
0
 public async Task InsertOrUpdateAsync(Cms cms)
 {
     if (cms.Id == 0)
     {
         await _cmsRepository.InsertAsync(cms);
     }
     else
     {
         await _cmsRepository.UpdateAsync(cms);
     }
 }
예제 #2
0
        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);
        }