public void AddFileAndSave(FileDTO file) { if (file.Id == null) { throw new Exception("Guid can't be null. Use hash for it."); } Repository.Add(FileMapper.ToFile(file)); Repository.Save(); }
public FileDTO GetFile(Guid guid) { return(FileMapper.ToFileDTO(Repository.Get(guid))); }