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)); } }
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)); } }