-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db.Exceptions | ||
{ | ||
public class CouldNotAddFileException: Exception | ||
Check warning on line 5 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check warning on line 5 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_9)
Check warning on line 5 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
|
||
{ | ||
public CouldNotAddFileException(): base("A file could not be added") | ||
Check warning on line 7 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check warning on line 7 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_9)
Check warning on line 7 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check warning on line 7 in src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/CouldNotAddFileException.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
|
||
{ | ||
|
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db.Exceptions | ||
{ | ||
/// <summary> | ||
/// Exception raised when downloading a file block for a database record and column that doesn't actually have a file against it | ||
/// </summary> | ||
public class FileToDownloadNotFoundException: Exception | ||
{ | ||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
/// <param name="entityReference">An entity reference of the record</param> | ||
/// <param name="fileAttributeName">The column where a file was not found</param> | ||
public FileToDownloadNotFoundException(EntityReference entityReference, string fileAttributeName) | ||
: base($"A file was not found for record with logical name '{entityReference.LogicalName}' and Id '{entityReference.Id.ToString()}' in column '{fileAttributeName}'") | ||
{ | ||
|
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using FakeXrmEasy.Core.FileStorage.Download; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db | ||
{ | ||
internal class FileDownloadSession | ||
{ | ||
internal string FileDownloadSessionId { get; set; } | ||
internal FileDownloadProperties Properties { get; set; } | ||
internal FileAttachment File { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
using FakeXrmEasy.Core.FileStorage.Download; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db | ||
{ | ||
internal interface IInMemoryFileDbDownloader | ||
{ | ||
string InitFileDownloadSession(FileDownloadProperties fileDownloadProperties); | ||
|
||
FileDownloadSession GetFileDownloadSession(string fileDownloadSessionId); | ||
|
||
List<FileDownloadSession> GetAllFileDownloadSessions(); | ||
|
||
byte[] DownloadFileBlock(DownloadBlockProperties uploadBlockProperties); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace FakeXrmEasy.Core.FileStorage.Download | ||
{ | ||
internal class DownloadBlockProperties | ||
{ | ||
internal string FileDownloadSessionId { get; set; } | ||
internal long BlockLength { get; set; } | ||
internal long Offset { get; set; } | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Download | ||
{ | ||
internal class FileDownloadProperties | ||
{ | ||
internal EntityReference Target { get; set; } | ||
internal string FileAttributeName { get; set; } | ||
|
||
internal FileDownloadProperties() | ||
{ | ||
|
||
} | ||
|
||
internal FileDownloadProperties(FileDownloadProperties other) | ||
{ | ||
if (other.Target != null) | ||
{ | ||
Target = new EntityReference(other.Target.LogicalName) | ||
Check failure on line 19 in src/FakeXrmEasy.Core/FileStorage/Download/FileDownloadProperties.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
Check failure on line 19 in src/FakeXrmEasy.Core/FileStorage/Download/FileDownloadProperties.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
Check failure on line 19 in src/FakeXrmEasy.Core/FileStorage/Download/FileDownloadProperties.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 19 in src/FakeXrmEasy.Core/FileStorage/Download/FileDownloadProperties.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
|
||
{ | ||
Id = other.Target.Id | ||
}; | ||
} | ||
|
||
FileAttributeName = other.FileAttributeName; | ||
} | ||
} | ||
} |