コード例 #1
0
ファイル: SiteRepository.cs プロジェクト: itsurge/cloudscribe
        public async Task <bool> Save(
            ISiteFolder siteFolder,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            if (siteFolder == null)
            {
                return(false);
            }
            cancellationToken.ThrowIfCancellationRequested();

            if (siteFolder.Guid == Guid.Empty)
            {
                siteFolder.Guid = Guid.NewGuid();

                return(await dbSiteFolder.Add(
                           siteFolder.Guid,
                           siteFolder.SiteGuid,
                           siteFolder.FolderName,
                           cancellationToken));
            }
            else
            {
                return(await dbSiteFolder.Update(
                           siteFolder.Guid,
                           siteFolder.SiteGuid,
                           siteFolder.FolderName,
                           cancellationToken));
            }
        }
コード例 #2
0
        public async Task <bool> Save(SiteFolder siteFolder)
        {
            if (siteFolder == null)
            {
                return(false);
            }

            if (siteFolder.Guid == Guid.Empty)
            {
                siteFolder.Guid = Guid.NewGuid();

                return(await dbSiteFolder.Add(
                           siteFolder.Guid,
                           siteFolder.SiteGuid,
                           siteFolder.FolderName));
            }
            else
            {
                return(await dbSiteFolder.Update(
                           siteFolder.Guid,
                           siteFolder.SiteGuid,
                           siteFolder.FolderName));
            }
        }