clean-architecture

IHttpContextAccessor.HttpContext.User.Identity shows all null properties in CurrentUserService service

谁都会走 提交于 2021-02-15 04:57:10
问题 I am trying to use Jason Taylor's Clean Architecture Template, this template uses NSwag to automatically create a TypeScript Client (Angular), but I don't need to create a TS client, so my main goal is to replace it with Razor Pages. I've been able to achieve this to a high grade, but I'm having trouble with the CurrentUserService whenever it gets instantiated it is supposed to set the UserId in this line: UserId = httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes

IHttpContextAccessor.HttpContext.User.Identity shows all null properties in CurrentUserService service

我的梦境 提交于 2021-02-15 04:54:09
问题 I am trying to use Jason Taylor's Clean Architecture Template, this template uses NSwag to automatically create a TypeScript Client (Angular), but I don't need to create a TS client, so my main goal is to replace it with Razor Pages. I've been able to achieve this to a high grade, but I'm having trouble with the CurrentUserService whenever it gets instantiated it is supposed to set the UserId in this line: UserId = httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes

How to wrap API responses to handle success and error based on Clean Architecture?

十年热恋 提交于 2021-01-28 12:48:51
问题 What is the approach to wrapping responses from the server and then process? The API is returning responses in the following format: SUCCESS: { "data": [], "statusCode": 200, "statusMessage": "Operation success", "success": true } FAILURE: { "errors": [], "statusCode": 500, "statusMessage": "Something went wrong", "success": false } I'm trying to apply Clean Architecture principles to my application and I want to know how can I wrap the responses to better handle errors? 回答1: fillCities()

How to wrap API responses to handle success and error based on Clean Architecture?

故事扮演 提交于 2021-01-28 12:46:16
问题 What is the approach to wrapping responses from the server and then process? The API is returning responses in the following format: SUCCESS: { "data": [], "statusCode": 200, "statusMessage": "Operation success", "success": true } FAILURE: { "errors": [], "statusCode": 500, "statusMessage": "Something went wrong", "success": false } I'm trying to apply Clean Architecture principles to my application and I want to know how can I wrap the responses to better handle errors? 回答1: fillCities()

Android app clean architecture: Should data layer have its own model classes?

孤街浪徒 提交于 2020-08-02 04:27:50
问题 What´s the best approach when developing an Android app and trying to follow clean architecture guidelines (but not extremely strict - cause that may be overkill for smaller projects). In my case, I am unsure which approach is the best (if there is a best one) regarding the data layer and if the data layer should operate on its own model classes or if it may operate directly on the domain layer models. Also, if the data layer should operate on its own model classes, should data sources like