aspnetboilerplate

How do you do File Upload method in AppServices for aspnetboilerplate?

这一生的挚爱 提交于 2020-01-21 09:13:07
问题 I really like aspnetboilerplate framework, I learning/using it now.. How do you do 'File Upload' logic/method in AppServices for aspnetboilerplate? The angular part have I figured out and is working fine. How is it intended to write the methods receiving a file upload in the appservice layer? There is good examples on crud, and swagger figures them out. Now I want to implement file upload. Is this even possible in the appservice layer, or do I have to do this in the controller methods? 回答1:

JSON serializer Not Working After Upgrade To 3.6.2

假装没事ソ 提交于 2020-01-20 08:53:28
问题 I'm using ASP.NET Boilerplate for one of my application. The application was on 3.5.0 version of Abp and the template was ASP.NET Core with MVC. I recently upgraded it to 3.6.2 the upgrade was fine but when I run it all AJAX calls are returning JSON data in CamelCase now, previously it was in PascalCase. I'm using DefaultContractResolver for JSON configuration I tried everything that was available in Google and StackOverflow, but no luck. I downloaded the latest ABP template and added

How to manage required features are not enabled exception in AspnetBoilerplate?

落爺英雄遲暮 提交于 2020-01-16 11:59:09
问题 According with AbpModuleZero 2.3 documentation https://aspnetboilerplate.com/Pages/Documents/v2.3.0/Feature-Management i would like to handle AbpAuthorizationException exception raised by a Controller decorated with the RequiresFeature attribute. For example, I would like to redirect to a static page or returning to home page. this is my controller implementation [AbpMvcAuthorize()] [RequiresFeature(AppFeatures.Trattative)] public class TrattativeController : BBWP_ABP_MPA_EFControllerBase {

How Do I Migrate Tenant Databases and Host Database in Asp.NET ZERO / Boilerplate?

本秂侑毒 提交于 2020-01-15 03:51:10
问题 I am using the ASP.NET ZERO framework with ASP.NET Core and Angular for my current project. I am also using the 'MultiTenancy - MultiDatabase' feature of ASP.Net ZERO. In application I have added a 'Tenant1-Database' connection string in create new Tenant. Now i have two databases: Host-Database Tenant1-Database When I create a new Tenant, 'Tenant1-Database' is automatically update as per previous migration files. But when I update the model with a new property and try to migrate the database

Calling SignalR service from a BackgroundWorker in ABP

≯℡__Kan透↙ 提交于 2020-01-14 03:21:10
问题 I have a BackgroundWorker which is supposed to broadcast something to all online clients in 5 seconds interval: DeactivationBackgroundWorker: public class DeactivationBackgroundWorker : PeriodicBackgroundWorkerBase, ISingletonDependency { private readonly IRepository<HitchRequest, long> _hitchRequestRepository; private readonly IHitchHub _hitchHub; public DeactivationBackgroundWorker(AbpTimer timer, IRepository<HitchRequest, long> hitchRequestRepository, IHitchHub hitchHub) : base(timer) {

The instance of entity type 'Product' cannot be tracked because another instance with the same key value is already being tracked

醉酒当歌 提交于 2020-01-10 05:11:14
问题 I made a test with code below to update the Product : var existing = await _productRepository.FirstOrDefaultAsync(c => c.Id == input.Id); if (existing == null) throw new UserFriendlyException(L("ProductNotExist")); var updatedEntity = ObjectMapper.Map<Product>(input); var entity = await _productRepository.UpdateAsync(updatedEntity); But it throws an exception: Mvc.ExceptionHandling.AbpExceptionFilter - The instance of entity type 'Product' cannot be tracked because another instance with the

Database migration adds new column Tenancy_Id when adding Tenant to User class

别说谁变了你拦得住时间么 提交于 2020-01-07 04:57:15
问题 I use boilerplate template with Angular, .NET Framework and Module Zero. I have added Tenant to User class and User list to Tenant class public class Tenant : AbpTenant<User> { public Tenant() { this.Users = new HashSet<User>(); } public ICollection<User> Users { get; set; } public Tenant(string tenancyName, string name) : base(tenancyName, name) { } } public class User : AbpUser<User> { public const string DefaultPassword = "123qwe"; public virtual Tenant Tenant { get; set; } public static

ASP.NET Boilerplate available list of exceptions and returned HTTP Status Codes

不羁岁月 提交于 2020-01-07 04:45:27
问题 I am building an API with ASP.NET Boilerplate and they abstract out the error handling and returning of the HTTP Status Codes. I have looked through the documentation and it only mentions UserFriendlyException and AbpValidationException. What are the other available exceptions I can throw with ASP.NET Boilerplate and its corresponding HTTP response codes that it returns? 回答1: Below are the exceptions and the correspondings status code according to the GetStatusCode() method: Abp.AbpException

How to add Username to AbpSession

梦想的初衷 提交于 2020-01-05 07:26:15
问题 Currently, AbpSession only provides UserId , but I want to use Username instead because it is more explicit so how can I do that? Please help 回答1: You can use UserManager class to retrieve the current user's information. Example usage in an application service: public async Task<string> GetCurrentUserName() { var user = await UserManager.FindByIdAsync(AbpSession.GetUserId().ToString()); return user.UserName; } If you want to use it in a custom class, then inject IAbpSession and UserManager

Error on first build after downloading project from ASP Net Boiler Plate with ASP.Net Core 1.x Multi Page Web Application

喜你入骨 提交于 2020-01-05 03:48:05
问题 I am using visual studio 2017. I just download project from asp net boiler plate and open it in vs 17. When i rebuild the solution i got the big list of 370 errors. Few are listed below due to the content limits. Severity Code Description Project File Line Suppression State Error Package Microsoft.AspNetCore.Server.Kestrel 2.0.0 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Server.Kestrel 2.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0