• 大小: 0.13M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: C#编程  

资源简介

C# Autofac 入门级示例

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutofacDemo
{
    public class DatabaseManager
    {
        IDatabase _database;
        User _user;

        public DatabaseManager(IDatabase database) : this(database null)
        {
        }

        public DatabaseManager(IDatabase database User user)
        {
            _database = database;
            _user = user;
        }

        /// 
        /// Check Authority
        /// 

        /// 
        public bool IsAuthority()
        {
            bool result = _user != null && _user.Id == 1 && _user.Name == “leepy“ ? true : false;
            if (!result)
                Console.WriteLine(“Not authority!“);

    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        875  2011-07-16 13:22  AutofacDemo.sln

    ..A..H.     24576  2011-07-16 14:25  AutofacDemo.suo

     文件        407  2011-07-16 14:15  AutofacDemo\App.config

     文件       3052  2011-07-16 14:35  AutofacDemo\AutofacDemo.csproj

     文件      30208  2011-07-10 16:56  AutofacDemo\bin\Debug\Autofac.Configuration.dll

     文件     185344  2011-07-10 16:56  AutofacDemo\bin\Debug\Autofac.dll

     文件     354562  2011-07-10 16:56  AutofacDemo\bin\Debug\Autofac.xml

     文件       8704  2011-07-16 16:08  AutofacDemo\bin\Debug\AutofacDemo.exe

     文件        407  2011-07-16 14:15  AutofacDemo\bin\Debug\AutofacDemo.exe.config

     文件      26112  2011-07-16 16:08  AutofacDemo\bin\Debug\AutofacDemo.pdb

     文件      11600  2011-07-16 14:21  AutofacDemo\bin\Debug\AutofacDemo.vshost.exe

     文件        407  2011-07-16 14:15  AutofacDemo\bin\Debug\AutofacDemo.vshost.exe.config

     文件        490  2010-03-17 22:39  AutofacDemo\bin\Debug\AutofacDemo.vshost.exe.manifest

     文件       1415  2011-07-16 15:50  AutofacDemo\DatabaseManager.cs

     文件        451  2011-07-16 15:19  AutofacDemo\IDatabase.cs

     文件        269  2011-07-16 14:11  AutofacDemo\Identity.cs

     文件        783  2011-07-16 15:46  AutofacDemo\obj\x86\Debug\AutofacDemo.csproj.FileListAbsolute.txt

     文件       8704  2011-07-16 16:08  AutofacDemo\obj\x86\Debug\AutofacDemo.exe

     文件      26112  2011-07-16 16:08  AutofacDemo\obj\x86\Debug\AutofacDemo.pdb

     文件       6034  2011-07-16 16:09  AutofacDemo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        954  2011-07-16 14:37  AutofacDemo\OracleDatabase.cs

     文件       2444  2011-07-16 16:15  AutofacDemo\Program.cs

     文件       1354  2011-07-16 13:22  AutofacDemo\Properties\AssemblyInfo.cs

     文件        954  2011-07-16 14:37  AutofacDemo\SqlDatabase.cs

     文件        251  2011-07-16 14:26  AutofacDemo\User.cs

     目录          0  2011-07-16 13:22  AutofacDemo\obj\x86\Debug\TempPE

     目录          0  2011-07-16 16:08  AutofacDemo\obj\x86\Debug

     目录          0  2011-07-16 14:37  AutofacDemo\bin\Debug

     目录          0  2011-07-16 14:25  AutofacDemo\bin\Release

     目录          0  2011-07-16 13:22  AutofacDemo\obj\x86

............此处省略7个文件信息

评论

共有 条评论