public async Task <RootFolderModelBussines <int> > CreateRootFolderAsync() { var rootFolderMB = new RootFolderModelBussines <int> { Path = this._hostingEnvironmentHelper.CreateRootFolder() }; return(await this._rootFolderRepository.CreateAsync(rootFolderMB)); }
public async Task <RootFolderModelBussines <int> > UpdateAsync(int id, RootFolderModelBussines <int> model) { model.Id = id; _context.RootFolders.Update(AutoMapperConfig.Mapper.Map <RootFolderModel <int> >(model)); await _context.SaveChangesAsync(); return(await GetByIdAsync(id)); }
public async Task <RootFolderModelBussines <int> > CreateAsync(RootFolderModelBussines <int> model) { var res = await _context.RootFolders.AddAsync( AutoMapperConfig.Mapper.Map <RootFolderModel <int> >(model) ); _context.SaveChanges(); return(await GetByIdAsync(res.Entity.Id)); }