using Autofac;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Module = Autofac.Module;

namespace Long.Service
{
    public class ServiceModule: Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            //当前程序集注入
            var assembly = Assembly.GetExecutingAssembly();
            builder.RegisterAssemblyTypes(assembly)
                .Where(c => c.Name.EndsWith("Service"))
                .PublicOnly()
                .Where(cc => cc.IsClass)
                .AsImplementedInterfaces();
        }
    }
}
