-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add User Module support to new Service code
IUserModule was moved to LukeBot.User.Common module. Additionally, Services supporting user modules should inherit IUserModuleFactory. Service code was expanded to support dependencies + tests were written for it. The rest of the project was adjusted to adapt to above changes.
- Loading branch information
Showing
73 changed files
with
1,738 additions
and
1,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using LukeBot.Common; | ||
using LukeBot.Config; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
using LukeBot.Common; | ||
using LukeBot.Config; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
LukeBot.Services/Exception/CircularServiceDependencyChain.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System.Collections.Generic; | ||
using LukeBot.Common; | ||
|
||
namespace LukeBot.Services | ||
{ | ||
internal class CircularServiceDependencyChain: System.Exception | ||
{ | ||
private List<string> mChain = new(); | ||
|
||
internal CircularServiceDependencyChain() | ||
{} | ||
|
||
internal void Add(string service) | ||
{ | ||
mChain.Add(service); | ||
} | ||
|
||
internal string FormMessage() | ||
{ | ||
string ret = ""; | ||
|
||
foreach (string s in mChain) | ||
{ | ||
ret += s; | ||
ret += " -> "; | ||
} | ||
|
||
ret += mChain[0]; | ||
return ret; | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
LukeBot.Services/Exception/CircularServiceDependencyException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Collections.Generic; | ||
using LukeBot.Common; | ||
|
||
namespace LukeBot.Services | ||
{ | ||
public class CircularServiceDependencyException: Exception | ||
{ | ||
List<string> mChain = new(); | ||
|
||
internal CircularServiceDependencyException(string service, CircularServiceDependencyChain chain) | ||
: base(string.Format("While resolving service {0} dependencies found a circular dependency: {1}", service, chain.FormMessage())) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
LukeBot.Services/Exception/ModuleAlreadyRegisteredException.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.