aspnetboilerplate

'unitOfWork parameter cannot be null' in Background Worker

爷,独闯天下 提交于 2019-12-02 09:45:35
I've started getting these errors. It was working perfectly on my previous server. using System; using Abp.Dependency; using Abp.Domain.Repositories; using Abp.Threading.BackgroundWorkers; using EMS.IPs; using System.Threading.Tasks.Dataflow; using System.Threading.Tasks; using System.Linq; using EMS.Contacts; using System.Collections.Concurrent; using Abp.Domain.Uow; using System.Collections.Generic; using EMS.EmailValidation; using Microsoft.AspNetCore.SignalR; using KellermanSoftware.NetEmailValidation; using System.Net; using System.Collections; using System.Threading; using System

How to call web API under specific user permission?

你说的曾经没有我的故事 提交于 2019-12-02 09:34:17
I have a function that allows the end user to execute a Workflow (containing many APIs) or schedule it to run as a background job. Example: User1 creates Workflow1 , which contains 3 APIs ( Api1 , Api2 , Api3 ), and configures it to run at 9AM every day. I use HttpClient to call each API like this: var client = new HttpClient { BaseAddress = new Uri("http://localhost/") }; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = client.PostAsJsonAsync("/api/services/myApp/workflow/Api1?input=something", "").Result; How do

Locale DateTime in ABP

淺唱寂寞╮ 提交于 2019-12-02 09:01:35
I have a DateTime field in popup modal as below that is supposed to only show the time part: HTML: <div class='input-group date'> <input class="form-control" type="datetime" #RequiredByDate name="RequiredByDate" [value]="formatDate(hitchRequest.requiredByDate, 'LT')" required> <span class="input-group-addon"> <span class="fa fa-clock-o"></span> </span> </div> TS: formatDate(date: any, format: string): string { if (!date) { return ''; } return moment(date).format(format); } onShown(): void { $(this.requiredByDate.nativeElement).datetimepicker({ locale: abp.localization.currentLanguage.name,

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

耗尽温柔 提交于 2019-12-02 07:42:42
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 have many methods like this so I don't want to use switch case to call them. I want to save this method

Getting Ambiguous match found exception while calling DeleteAsync

醉酒当歌 提交于 2019-12-02 06:02:25
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, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type

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

大兔子大兔子 提交于 2019-12-02 04:53:45
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 get to " Deleting " the users, I can see an exception in the console output as shown in the picture: I

Retrieve child entities from CrudAppService in ABP

微笑、不失礼 提交于 2019-11-30 20:30:52
问题 The GetAll and Get methods of the ready-made CrudAppService don't include child entities. Is it possible to modify its behaviour? Update GetAllIncluding has some problem if the included entity has a navigation property to the parent; it falls into a sort of circular dependency. Is there any Attribute or trick to exclude the navigation property from the serialization? The [NonSerialized] attribute does not seem to be applicable to a navigation property. PostAppService : public class

What could cause an error related to npm not being able to find a file? No contents in my node_modules subfolder. Why is that?

落花浮王杯 提交于 2019-11-30 19:16:14
I'm trying to run npm install in the angular project folder I got from ASP.NET Boilerplate and I'm getting an error that is "related to npm not being able to find a file." D:\Dev\AspNetBoilerplate\MyProject\3.5.0\angular>npm install npm WARN deprecated @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed! npm WARN codelyzer@3.2.2 requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself.

How to setup Social Login in ASP.NET Boilerplate?

巧了我就是萌 提交于 2019-11-30 15:42:33
问题 I'm trying to authenticate users through Google. I'm using the ABP startup template for ASP.NET Core with Vue. Here's what I have done so far: I've created a GoogleAuthProviderApi in Web.Core: using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication.Google; using Newtonsoft.Json.Linq; namespace Mindbus.MindbooksSEO.Authentication.External.Google { public class GoogleAuthProviderApi : ExternalAuthProviderApiBase

Integrated Windows Authentication in ABP framework

半城伤御伤魂 提交于 2019-11-29 18:17:37
I'm attempting to use ABP with Windows Authentication rather than Table-based authentication. The plan is to have the framework: Detect that the website is in a Windows security context and bypass the login page. Then associate Windows Identity/Roles and use those to map the Roles/Permissions defined in the database. I did not see anything in the documentation regarding this Windows-integrated approach. If anyone has done this previously, I appreciate any tips. I think my best bet would be to use Policy-based authorization. So where the controllers currently use ABP auth attributes, I'll