public async Task Post([FromBody] FolderDTO folder) { FolderEntity entity = FolderConverter.ToEntity(folder); this.context.Folders.Add(entity); await this.context.SaveChangesAsync(); }
public IFacadeUpdateResult <FolderData> SaveFolder(FolderDto instance, object languageId) { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey)) { FolderFacade facade = new FolderFacade(uow); IFacadeUpdateResult <FolderData> result = facade.SaveFolderLanguage(FolderConverter.ConvertToData(instance), languageId); return(result); } }
public void TestSaveFolder() { // Mock data FolderDto dto = new FolderDto(); dto.Name = "test1"; dto.ParentId = 2; dto.FolderType = FolderType.Content; dto.IsPublished = true; dto.IsSubsiteRoot = true; dto.Sort = 201; dto.Slug = "test1"; FolderData data = FolderConverter.ConvertToData(dto); FolderFacade facade = new FolderFacade(UnitOfWork); IFacadeUpdateResult <FolderData> result = facade.SaveFolder(data); if (result.IsSuccessful) { } }