Last active
July 2, 2021 05:54
-
-
Save hikalkan/caf54a092c929e4c558b to your computer and use it in GitHub Desktop.
Simple console application with ABP and EF.
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
[DependsOn(typeof(AbpEntityFrameworkModule))] | |
public class MyModule : AbpModule | |
{ | |
public override void Initialize() | |
{ | |
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly()); | |
} | |
} |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var bootstrapper = new AbpBootstrapper()) | |
{ | |
bootstrapper.Initialize(); | |
var tester = IocManager.Instance.Resolve<Tester>(); | |
tester.DoTests(); | |
Console.WriteLine("Press enter to stop application..."); | |
Console.ReadLine(); | |
} | |
} | |
} |
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
public class Tester : ITransientDependency | |
{ | |
private IMyAppService _appService; | |
public Tester(IMyAppService appService) | |
{ | |
_appService = appService; | |
} | |
public void DoTests() | |
{ | |
//Use _appService here... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: This code is written for ABP 0.4. Module code will be different for v0.3.2. See docs: http://www.aspnetboilerplate.com/Pages/Documents/Module-System