aspnetboilerplate

How to open database connection in a BackgroundJob in ABP application

不想你离开。 提交于 2019-12-02 18:52:14
问题 Issue For testing, I create a new job, it just use IRepository to read data from database. The code as below: public class TestJob : BackgroundJob<string>, ITransientDependency { private readonly IRepository<Product, long> _productRepository; private readonly IUnitOfWorkManager _unitOfWorkManager; public TestJob(IRepository<Product, long> productRepository, IUnitOfWorkManager unitOfWorkManager) { _productRepository = productRepository; _unitOfWorkManager = unitOfWorkManager; } public override

How to make composite unique key in ASP.NET Boilerplate?

余生颓废 提交于 2019-12-02 16:48:23
问题 I have a table which has the Id as primary key, I want to have a composite unique key on Code and Value column. I'm trying in this way. [Table("Test")] public class Test: FullAuditedEntity { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public virtual int Code { get; set; } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public virtual int Value { get; set; } But it's making the composite primary key not unique key. 回答1: Try this: public class SomeClass : Entity<int> {

How to use LDAP in ASP.NET Boilerplate (Free Startup Template)

狂风中的少年 提交于 2019-12-02 16:45:09
问题 I would like to integrate authentication via Active Directory in my .net Core app using Free Startup Template version of the Boilerplate. I followed the instruction in the documentation such as installing Abp.Zero.Ldap package, creating LdapAuthenticationSource class, and injecting dependency like: [DependsOn(typeof(AbpZeroLdapModule))] public class MyApplicationCoreModule : AbpModule { public override void PreInitialize() { Configuration.Modules.ZeroLdap().Enable(typeof

How to use reflection to call a API by string name?

橙三吉。 提交于 2019-12-02 16:31:41
问题 How to call an API in another AppService by string name? Example: I have an API as below in MyAppService public class MyAppService : MyAppServiceBase, IMyAppService { private readonly IRepository<MyEntity> _myEntityRepository; public CommonLookupAppService(IRepository<MyEntity> myEntityRepository) { _myEntityRepository = myEntityRepository; } public async Task<MyOutput> MyMethod (MyInput input) { } } How to save MyMethod as a string into the database and invoke it in another app service? I

How to change ASP.NET Boilerplate Angular Template UI Theme (Adminbsb)

心已入冬 提交于 2019-12-02 13:59:51
问题 I'm starting a project with ASP.NET Boilerplate Angular Template but I want to change the UI theme for another as Core UI theme. someone who has worked with ASP.NET Boilerplate Angular Template could help me? 回答1: I've changed the template in many times and what I dit was put all elements of new template in relative route in abp's base template, then after that I design again the default registers (Login screen, register, users, roles, tenant) because the HTML changes, I do the changes in at

Getting Ambiguous match found exception while calling DeleteAsync

爱⌒轻易说出口 提交于 2019-12-02 12:23:03
问题 I have a table which has code as primary key instead of Id, When I call DeleteAsync method I get the exception Ambiguous match found . [Table("Test")] public class Test: FullAuditedEntity<int> { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] new public int Id { get; set; } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public virtual int Code { get; set; } _testRepository.DeleteAsync(code); StackTrace: at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr

Promise error in ASP.NET Boilerplate (Core 2.0 + Angular 5) Free Template

天大地大妈咪最大 提交于 2019-12-02 12:18:14
问题 I have been using ASP.NET Boilerplate to do CRUD Operations with the database with a REST API client like Postman using custom APIs and so far , it's working quite well. But then when I move on to the frontend part, there is an unhandled exception in Users Component after logging in with an Admin account. First of all, I can see the list of users that I added, from which I can say the Create and Get operations are running properly (I also tested editing the users and it worked well). When I

How does the JavaScript Create-Update-Delete actually work?

ぃ、小莉子 提交于 2019-12-02 11:51:14
Using MVC Template with jQuery ASP.Net Core 2.0 Taking the code below as an example, I'm unclear as to actually what or how this call is constructed and what path it takes (API or direct ref to app services). snipped... I do understand that the fetches from the Controllers are via the Application Services directly (not API calls) using the template in it's default state. It's just the create/update/delete calls via the JavaScript that has me a slightly confused. It is an API call. How it actually works... From the documentation on Client Proxies : ABP can automatically create JavaScript

How to open database connection in a BackgroundJob in ABP application

旧城冷巷雨未停 提交于 2019-12-02 10:02:18
Issue For testing, I create a new job, it just use IRepository to read data from database. The code as below: public class TestJob : BackgroundJob<string>, ITransientDependency { private readonly IRepository<Product, long> _productRepository; private readonly IUnitOfWorkManager _unitOfWorkManager; public TestJob(IRepository<Product, long> productRepository, IUnitOfWorkManager unitOfWorkManager) { _productRepository = productRepository; _unitOfWorkManager = unitOfWorkManager; } public override void Execute(string args) { var task = _productRepository.GetAll().ToListAsync(); var items = task

How to make composite unique key in ASP.NET Boilerplate?

*爱你&永不变心* 提交于 2019-12-02 09:54:33
I have a table which has the Id as primary key, I want to have a composite unique key on Code and Value column. I'm trying in this way. [Table("Test")] public class Test: FullAuditedEntity { [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public virtual int Code { get; set; } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public virtual int Value { get; set; } But it's making the composite primary key not unique key. Try this: public class SomeClass : Entity<int> { [Column("Code")] public override int Id {get; set;} public virtual string Name { get; set; } } [DatabaseGenerated