mirror of https://github.com/abpframework/abp.git
11 changed files with 127 additions and 50 deletions
@ -0,0 +1,28 @@ |
|||||
|
using System; |
||||
|
using Volo.Docs.Projects; |
||||
|
|
||||
|
namespace Volo.Docs.Documents |
||||
|
{ |
||||
|
public static class ProjectGithubExtensions |
||||
|
{ |
||||
|
public static string GetGithubUrl(this Projects.Project project) |
||||
|
{ |
||||
|
CheckGithubProject(project); |
||||
|
return project.ExtraProperties["GithubRootUrl"] as string; |
||||
|
} |
||||
|
|
||||
|
public static void SetGithubUrl(this Projects.Project project, string value) |
||||
|
{ |
||||
|
CheckGithubProject(project); |
||||
|
project.ExtraProperties["GithubRootUrl"] = value; |
||||
|
} |
||||
|
|
||||
|
private static void CheckGithubProject(Project project) |
||||
|
{ |
||||
|
if (project.DocumentStoreType != GithubDocumentStore.Type) |
||||
|
{ |
||||
|
throw new ApplicationException("Given project has not a Github document store!"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Runtime.Serialization; |
||||
|
using Volo.Abp; |
||||
|
|
||||
|
namespace Volo.Docs.Documents |
||||
|
{ |
||||
|
[Serializable] |
||||
|
public class DocumentNotFoundException : BusinessException |
||||
|
{ |
||||
|
public string DocumentUrl { get; set; } |
||||
|
|
||||
|
public DocumentNotFoundException(SerializationInfo serializationInfo, StreamingContext context) |
||||
|
: base(serializationInfo, context) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public DocumentNotFoundException(string documentUrl) |
||||
|
{ |
||||
|
DocumentUrl = documentUrl; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue