در بعضی از سناریوها تنها برگرداندن پیام خطا از سمت سرور به کلاینت به تنهایی کافی نیست و نیاز هست اطلاعات بیشتری از سمت سرور برگردانده شوند تا کلاینت بهتر بتواند تصمیم گیری کند که بر اساس خطا چه عملی باید انجام دهد مثلا کاربر هنوز شماره موبایلش را تایید نکرده و بعد از لاگین باید به صفحه تایید شماره موبایل هدایت شود و اینجاست که در کنار پیام خطا، کد خطا کمک کننده است.
Why Serilog? It is easy to set up, has a clean API, and is portable between recent .NET platforms. The big difference between Serilog and the other frameworks is that it is designed to do structured logging out of the box. Another thing I really like about Serilog is that it can be configured via the appsetting.json
file alongside configuring through code. Changing logging configuration without touching the codebase is really helpful, especially in the production environment.
You already know how role-based authorization works in ASP.NET Core.
[Authorize(Roles = "Administrator")] public class AdministrationController : Controller { }
But what if you don't want hardcode roles on the Authorize
attribute or create roles later and specify in which controller and action it has access without touching source code?
DynamicAuthorization helps you authorize users without hardcoding role(s) on the Authorize
attribute with minimum effort. DynamicAuthorization is built at the top
of ASP.NET Core Identity and use identity mechanism for managing roles
and authorizing users.
We are excited to announce the release of .NET Core 1.0, ASP.NET Core 1.0 and Entity Framework 1.0, available on Windows, OS X and Linux! .NET Core is a cross-platform, open source, and modular .NET platform for creating modern web apps, microservices, libraries and console applications.
This release includes the .NET Core runtime, libraries and tools and the ASP.NET Core libraries. We are also releasing Visual Studio and Visual Studio Code extensions that enable you to create .NET Core projects. You can get started at https://dot.net/core. Read the release notes for detailed release information.