Thực hiện AOP bằng AutoFac trong .NET Core
Thêm thư viện cần thiết
Sử dụng Nuget để cài đặt gói Autofac.Extras.DynamicProxy.
Xây dựng lớp ghi nhận hành vi
/// <summary>
/// Lớp xử lý giao diện (thực hiện Castle.DynamicProxy.IInterceptor)
/// </summary>
public class GhiNhanKetQua : IInterceptor
{
public void Intercept(IInvocation invocation)
{
Console.WriteLin ...
Đăng vào ngày 29 tháng 6 lúc 06:52
Giới thiệu ABP với dự án Console .NET Core (Phần 1)
Đầu tiên, cần tải xuống các thư viện Nuget sau: Volo.Abp.Core và Volo.Abp.Autofac.
Project Structure (Cấu trúc dự án)
Bạn cần thêm mã nguồn vào file Program.cs:
using MyConsoleApp;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp.Modularity.PlugIns;
static IHostBuilder CreateHostBuilder(stri ...
Đăng vào ngày 30 tháng 5 lúc 14:23