浏览代码

Restliche Entities, div. Enitity-Maps erstellt und DbContext-Dependency für DbContextService erstellt, sowie HomeController zum ersten Einpflegen von Daten

Arne Diekmann 8 年之前
父节点
当前提交
8028afcf4e
共有 38 个文件被更改,包括 898 次插入15 次删除
  1. 6 0
      GreenTree.Nachtragsmanagement.Core/Domain/Appendix/Appendix.cs
  2. 15 0
      GreenTree.Nachtragsmanagement.Core/Domain/Deviation/Deviation.cs
  3. 37 0
      GreenTree.Nachtragsmanagement.Core/Domain/Site/Site.cs
  4. 23 0
      GreenTree.Nachtragsmanagement.Core/Domain/User/Role.cs
  5. 49 0
      GreenTree.Nachtragsmanagement.Core/Domain/User/User.cs
  6. 1 0
      GreenTree.Nachtragsmanagement.Core/GreenTree.Nachtragsmanagement.Core.csproj
  7. 74 1
      GreenTree.Nachtragsmanagement.Data/AppendixObjectContext.cs
  8. 11 3
      GreenTree.Nachtragsmanagement.Data/GreenTree.Nachtragsmanagement.Data.csproj
  9. 8 1
      GreenTree.Nachtragsmanagement.Data/IDbContext.cs
  10. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Appendix/AppendixMap.cs
  11. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Appendix/CategoryMap.cs
  12. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/DisturbanceMap.cs
  13. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/KindMap.cs
  14. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/StatusMap.cs
  15. 23 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Invoice/InvoiceMap.cs
  16. 34 0
      GreenTree.Nachtragsmanagement.Data/Mapping/Site/SiteMap.cs
  17. 21 0
      GreenTree.Nachtragsmanagement.Data/Mapping/User/FunctionMap.cs
  18. 26 0
      GreenTree.Nachtragsmanagement.Data/Mapping/User/RoleMap.cs
  19. 28 0
      GreenTree.Nachtragsmanagement.Data/Mapping/User/UserMap.cs
  20. 69 0
      GreenTree.Nachtragsmanagement.Services/DbContext/DbContextService.cs
  21. 31 0
      GreenTree.Nachtragsmanagement.Services/DbContext/IDbContextService.cs
  22. 7 0
      GreenTree.Nachtragsmanagement.Services/GreenTree.Nachtragsmanagement.Services.csproj
  23. 89 0
      GreenTree.Nachtragsmanagement.Web.Framework/ApplicationContext.cs
  24. 46 0
      GreenTree.Nachtragsmanagement.Web.Framework/GreenTree.Nachtragsmanagement.Web.Framework.csproj
  25. 87 0
      GreenTree.Nachtragsmanagement.Web.Framework/Singleton.cs
  26. 9 0
      GreenTree.Nachtragsmanagement.Web.Framework/packages.config
  27. 1 1
      GreenTree.Nachtragsmanagement.Web/App_Start/FilterConfig.cs
  28. 1 1
      GreenTree.Nachtragsmanagement.Web/App_Start/RouteConfig.cs
  29. 1 1
      GreenTree.Nachtragsmanagement.Web/App_Start/WebApiConfig.cs
  30. 40 0
      GreenTree.Nachtragsmanagement.Web/Controllers/HomeController.cs
  31. 1 1
      GreenTree.Nachtragsmanagement.Web/Global.asax
  32. 5 1
      GreenTree.Nachtragsmanagement.Web/Global.asax.cs
  33. 14 2
      GreenTree.Nachtragsmanagement.Web/GreenTree.Nachtragsmanagement.Web.csproj
  34. 15 0
      GreenTree.Nachtragsmanagement.Web/Models/User/UserModel.cs
  35. 2 2
      GreenTree.Nachtragsmanagement.Web/Properties/AssemblyInfo.cs
  36. 17 0
      GreenTree.Nachtragsmanagement.Web/Views/Home/Index.cshtml
  37. 1 1
      GreenTree.Nachtragsmanagement.Web/Web.config
  38. 1 0
      GreenTree.Nachtragsmanagement.Web/packages.config

+ 6 - 0
GreenTree.Nachtragsmanagement.Core/Domain/Appendix/Appendix.cs

@@ -8,6 +8,12 @@ namespace GreenTree.Nachtragsmanagement.Core.Domain.Appendix
 {
     public class Appendix : BaseEntity
     {
+        #region Fields
+
+        private ICollection<Category> _categories;
+
+        #endregion
+
         /// <summary>
         /// Id of corresponding site
         /// </summary>

+ 15 - 0
GreenTree.Nachtragsmanagement.Core/Domain/Deviation/Deviation.cs

@@ -18,16 +18,31 @@ namespace GreenTree.Nachtragsmanagement.Core.Domain.Deviation
         /// </summary>
         public int StatusId { get; set; }
 
+        /// <summary>
+        /// Current deviation status
+        /// </summary>
+        public Status Status { get; set; }
+
         /// <summary>
         /// Id of the current deviation disturbance
         /// </summary>
         public int DisturbanceId { get; set; }
 
+        /// <summary>
+        /// Current deviation disturbance
+        /// </summary>
+        public Disturbance Disturbance { get; set; }
+
         /// <summary>
         /// Id of the current deviation kind
         /// </summary>
         public int KindId { get; set; }
 
+        /// <summary>
+        /// Current deviation kind
+        /// </summary>
+        public Kind Kind { get; set; }
+
         /// <summary>
         /// Customized number for identification
         /// </summary>

+ 37 - 0
GreenTree.Nachtragsmanagement.Core/Domain/Site/Site.cs

@@ -8,6 +8,25 @@ namespace GreenTree.Nachtragsmanagement.Core.Domain.Site
 {
     public class Site : BaseEntity
     {
+        #region Fields
+
+        /// <summary>
+        /// Userlist
+        /// </summary>
+        private ICollection<User.User> _users;
+
+        /// <summary>
+        /// Appendixlist
+        /// </summary>
+        private ICollection<Appendix.Appendix> _appendices;
+
+        #endregion
+
+        /// <summary>
+        /// CustomNumber for identification
+        /// </summary>
+        public int CustomNumber { get; set; }
+
         /// <summary>
         /// Description
         /// </summary>
@@ -37,5 +56,23 @@ namespace GreenTree.Nachtragsmanagement.Core.Domain.Site
         /// Determines if the site is completely finished
         /// </summary>
         public bool Finished { get; set; }
+
+        /// <summary>
+        /// Users responsible for this site
+        /// </summary>
+        public virtual ICollection<User.User> Users
+        {
+            get { return _users ?? ( _users = new List<User.User>()); }
+            protected set { _users = value; }
+        }
+
+        /// <summary>
+        /// Appendices related to the site
+        /// </summary>
+        public virtual ICollection<Appendix.Appendix> Appendices
+        {
+            get { return _appendices ?? (_appendices = new List<Appendix.Appendix>()); }
+            protected set { _appendices = value; }
+        }
     }
 }

+ 23 - 0
GreenTree.Nachtragsmanagement.Core/Domain/User/Role.cs

@@ -8,9 +8,32 @@ namespace GreenTree.Nachtragsmanagement.Core.Domain.User
 {
     public class Role : BaseEntity
     {
+        #region Fields
+
+        /// <summary>
+        /// Functionlist
+        /// </summary>
+        private ICollection<Function> _functions;
+
+        #endregion
+
         /// <summary>
         /// Description
         /// </summary>
         public string Description { get; set; }
+
+        /// <summary>
+        /// Level of right (higher value means higher right)
+        /// </summary>
+        public int Level { get; set; }
+
+        /// <summary>
+        /// Functions the role have
+        /// </summary>
+        public virtual ICollection<Function> Functions
+        {
+            get { return _functions ?? (_functions = new List<Function>()); }
+            protected set { _functions = value; }
+        }
     }
 }

+ 49 - 0
GreenTree.Nachtragsmanagement.Core/Domain/User/User.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Core.Domain.User
+{
+    public class User : BaseEntity
+    {
+        #region Fields
+
+        /// <summary>
+        /// Rolelist
+        /// </summary>
+        private ICollection<Role> _roles;
+
+        #endregion
+
+        /// <summary>
+        /// CustomId for identification
+        /// </summary>
+        public int CustomId { get; set; }
+
+        /// <summary>
+        /// Forename
+        /// </summary>
+        public string Forename { get; set; }
+
+        /// <summary>
+        /// Lastname
+        /// </summary>
+        public string Lastname { get; set; }
+
+        /// <summary>
+        /// Mail-Address
+        /// </summary>
+        public string MailAddress { get; set; }
+
+        /// <summary>
+        /// Roles the user have
+        /// </summary>
+        public virtual ICollection<Role> Roles
+        {
+            get { return _roles ?? (_roles = new List<Role>()); }
+            protected set { _roles = value; }
+        }
+    }
+}

+ 1 - 0
GreenTree.Nachtragsmanagement.Core/GreenTree.Nachtragsmanagement.Core.csproj

@@ -52,6 +52,7 @@
     <Compile Include="Domain\Site\Site.cs" />
     <Compile Include="Domain\User\Function.cs" />
     <Compile Include="Domain\User\Role.cs" />
+    <Compile Include="Domain\User\User.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup />

+ 74 - 1
GreenTree.Nachtragsmanagement.Data/AppendixObjectContext.cs

@@ -8,11 +8,25 @@ using System.Reflection;
 using System.Text;
 using System.Threading.Tasks;
 using GreenTree.Nachtragsmanagement.Core;
+using GreenTree.Nachtragsmanagement.Core.Domain.Appendix;
+using GreenTree.Nachtragsmanagement.Core.Domain.Deviation;
+using GreenTree.Nachtragsmanagement.Core.Domain.Invoice;
+using GreenTree.Nachtragsmanagement.Core.Domain.Site;
+using GreenTree.Nachtragsmanagement.Core.Domain.User;
+using GreenTree.Nachtragsmanagement.Data.Mapping.Deviation;
+using GreenTree.Nachtragsmanagement.Data.Mapping.Site;
+using GreenTree.Nachtragsmanagement.Data.Mapping.User;
 
 namespace GreenTree.Nachtragsmanagement.Data
 {
     public class AppendixObjectContext : DbContext, IDbContext
     {
+        #region DbSets
+
+        private List<object> _dbSets = new List<object>();
+
+        #endregion
+
         #region Ctor
 
         /// <summary>
@@ -23,6 +37,41 @@ namespace GreenTree.Nachtragsmanagement.Data
             : base(nameOrConnectionString)
         {
             //((IObjectContextAdapter) this).ObjectContext.ContextOptions.LazyLoadingEnabled = true;
+
+            var userSet = Set<User>();
+            var roleSet = Set<Role>();
+            var functionSet = Set<Function>();
+            var siteSet = Set<Site>();
+            var invoiceSet = Set<Invoice>();
+            var statusSet = Set<Status>();
+            var kindSet = Set<Kind>();
+            var disturbanceSet = Set<Disturbance>();
+            var deviationSet = Set<Deviation>();
+            var categorySet = Set<Category>();
+            var appendixSet = Set<Appendix>();
+
+            _dbSets.AddRange(
+                new object[] 
+                {
+                    userSet,
+                    roleSet,
+                    functionSet,
+                    siteSet,
+                    invoiceSet,
+                    statusSet,
+                    kindSet,
+                    disturbanceSet,
+                    deviationSet,
+                    categorySet,
+                    appendixSet
+                }
+            );
+
+            Database.SetInitializer(new CreateDatabaseIfNotExists<AppendixObjectContext>());
+
+            Database.CreateIfNotExists();
+
+            SaveChanges();
         }
 
         #endregion
@@ -31,6 +80,16 @@ namespace GreenTree.Nachtragsmanagement.Data
 
         protected override void OnModelCreating(DbModelBuilder modelBuilder)
         {
+            modelBuilder.Configurations.Add(new UserMap());
+            modelBuilder.Configurations.Add(new RoleMap());
+            modelBuilder.Configurations.Add(new FunctionMap());
+            modelBuilder.Configurations.Add(new SiteMap());
+            modelBuilder.Configurations.Add(new InvoiceMap());
+            modelBuilder.Configurations.Add(new StatusMap());
+            modelBuilder.Configurations.Add(new KindMap());
+            modelBuilder.Configurations.Add(new DisturbanceMap());
+            modelBuilder.Configurations.Add(new CategoryMap());
+
             base.OnModelCreating(modelBuilder);
         }
 
@@ -70,7 +129,21 @@ namespace GreenTree.Nachtragsmanagement.Data
         }
 
         /// <summary>
-        /// Get DbSet
+        /// Get the DbSet of a specific entity which inherits the BaseEntity class
+        /// </summary>
+        /// <typeparam name="TEntity"></typeparam>
+        /// <returns></returns>
+        public IDbSet<TEntity> Get<TEntity>() where TEntity : BaseEntity
+        {
+            var entityType = typeof(TEntity);
+            var dbSet = _dbSets
+                .FirstOrDefault(d => d.GetType().GetGenericArguments()[0].FullName == entityType.FullName);
+
+            return (IDbSet<TEntity>)dbSet;
+        }
+
+        /// <summary>
+        /// Set DbSet
         /// </summary>
         /// <typeparam name="TEntity">Entity type</typeparam>
         /// <returns>DbSet</returns>

+ 11 - 3
GreenTree.Nachtragsmanagement.Data/GreenTree.Nachtragsmanagement.Data.csproj

@@ -49,6 +49,16 @@
   <ItemGroup>
     <Compile Include="AppendixObjectContext.cs" />
     <Compile Include="IDbContext.cs" />
+    <Compile Include="Mapping\Appendix\AppendixMap.cs" />
+    <Compile Include="Mapping\Appendix\CategoryMap.cs" />
+    <Compile Include="Mapping\Deviation\DisturbanceMap.cs" />
+    <Compile Include="Mapping\Deviation\KindMap.cs" />
+    <Compile Include="Mapping\Deviation\StatusMap.cs" />
+    <Compile Include="Mapping\Invoice\InvoiceMap.cs" />
+    <Compile Include="Mapping\Site\SiteMap.cs" />
+    <Compile Include="Mapping\User\FunctionMap.cs" />
+    <Compile Include="Mapping\User\RoleMap.cs" />
+    <Compile Include="Mapping\User\UserMap.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -61,8 +71,6 @@
     <None Include="App.config" />
     <None Include="packages.config" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Mapping\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 8 - 1
GreenTree.Nachtragsmanagement.Data/IDbContext.cs

@@ -11,12 +11,19 @@ namespace GreenTree.Nachtragsmanagement.Data
     public interface IDbContext
     {
         /// <summary>
-        /// Get DbSet
+        /// Set DbSet
         /// </summary>
         /// <typeparam name="TEntity">Entity type</typeparam>
         /// <returns>DbSet</returns>
         IDbSet<TEntity> Set<TEntity>() where TEntity : BaseEntity;
 
+        /// <summary>
+        /// Get DbSet
+        /// </summary>
+        /// <typeparam name="TEntity">Entity type</typeparam>
+        /// <returns>DbSet</returns>
+        IDbSet<TEntity> Get<TEntity>() where TEntity : BaseEntity;
+
         /// <summary>
         /// Save changes
         /// </summary>

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Appendix/AppendixMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Appendix
+{
+    public class AppendixMap : EntityTypeConfiguration<Core.Domain.Appendix.Appendix>
+    {
+        public AppendixMap()
+        {
+            ToTable("Appendix");
+
+            HasKey(a => a.Id);
+
+
+        }
+    }
+}

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Appendix/CategoryMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Deviation
+{
+    public class CategoryMap : EntityTypeConfiguration<Core.Domain.Appendix.Category>
+    {
+        public CategoryMap()
+        {
+            ToTable("Category");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.Description);
+        }
+    }
+}

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/DisturbanceMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Deviation
+{
+    public class DisturbanceMap : EntityTypeConfiguration<Core.Domain.Deviation.Disturbance>
+    {
+        public DisturbanceMap()
+        {
+            ToTable("Disturbance");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.Description);
+        }
+    }
+}

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/KindMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Deviation
+{
+    public class KindMap : EntityTypeConfiguration<Core.Domain.Deviation.Kind>
+    {
+        public KindMap()
+        {
+            ToTable("Kind");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.Description);
+        }
+    }
+}

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Deviation/StatusMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Deviation
+{
+    public class StatusMap : EntityTypeConfiguration<Core.Domain.Deviation.Status>
+    {
+        public StatusMap()
+        {
+            ToTable("Status");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.Description);
+        }
+    }
+}

+ 23 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Invoice/InvoiceMap.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Deviation
+{
+    public class InvoiceMap : EntityTypeConfiguration<Core.Domain.Invoice.Invoice>
+    {
+        public InvoiceMap()
+        {
+            ToTable("Invoice");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.CustomNumber);
+            Property(f => f.Date);
+            Property(f => f.Value);
+        }
+    }
+}

+ 34 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/Site/SiteMap.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.Site
+{
+    public class SiteMap : EntityTypeConfiguration<Core.Domain.Site.Site>
+    {
+        public SiteMap()
+        {
+            ToTable("Site");
+
+            HasKey(s => s.Id);
+
+            Property(s => s.CustomNumber);
+            Property(s => s.Description);
+            Property(s => s.Department);
+            Property(s => s.Comment);
+            Property(s => s.Start);
+            Property(s => s.End);
+            Property(s => s.Finished);
+
+            HasMany(s => s.Users)
+                .WithMany()
+                .Map(m => m.ToTable("SiteUsers"));
+
+            HasMany(s => s.Appendices)
+                .WithOptional();
+        }
+    }
+}

+ 21 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/User/FunctionMap.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.User
+{
+    public class FunctionMap : EntityTypeConfiguration<Core.Domain.User.Function>
+    {
+        public FunctionMap()
+        {
+            ToTable("Function");
+
+            HasKey(f => f.Id);
+
+            Property(f => f.Description);
+        }
+    }
+}

+ 26 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/User/RoleMap.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.User
+{
+    public class RoleMap : EntityTypeConfiguration<Core.Domain.User.Role>
+    {
+        public RoleMap()
+        {
+            ToTable("Role");
+
+            HasKey(r => r.Id);
+
+            Property(r => r.Description);
+            Property(r => r.Level);
+
+            HasMany(r => r.Functions)
+                .WithMany()
+                .Map(m => m.ToTable("RoleFunctions"));
+        }
+    }
+}

+ 28 - 0
GreenTree.Nachtragsmanagement.Data/Mapping/User/UserMap.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity.ModelConfiguration;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Data.Mapping.User
+{
+    public class UserMap : EntityTypeConfiguration<Core.Domain.User.User>
+    {
+        public UserMap()
+        {
+            ToTable("User");
+
+            HasKey(u => u.Id);
+
+            Property(u => u.CustomId);
+            Property(u => u.Forename);
+            Property(u => u.Lastname);
+            Property(u => u.MailAddress);
+
+            HasMany(c => c.Roles)
+                .WithMany()
+                .Map(m => m.ToTable("UserRoles"));
+        }
+    }
+}

+ 69 - 0
GreenTree.Nachtragsmanagement.Services/DbContext/DbContextService.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GreenTree.Nachtragsmanagement.Core;
+using GreenTree.Nachtragsmanagement.Data;
+
+namespace GreenTree.Nachtragsmanagement.Services.DbContext
+{
+    public class DbContextService : IDbContextService
+    {
+        #region Fields
+
+        /// <summary>
+        /// Current database context
+        /// </summary>
+        private readonly IDbContext _dbContext;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the DbContextService class
+        /// </summary>
+        public DbContextService(IDbContext iDbContext)
+        {
+            _dbContext = iDbContext;
+        }
+
+        #endregion
+
+        #region Services
+
+        /// <summary>
+        /// Checks if a DbSet exists in the curent DbContext
+        /// </summary>
+        /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
+        public bool DbSetExists<TEntity>() where TEntity : BaseEntity
+        {
+            var dbSet = _dbContext.Get<TEntity>();
+
+            return dbSet != null;
+        }
+
+        /// <summary>
+        /// Get the DbSet of the corresponding Entity type
+        /// </summary>
+        /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
+        public IDbSet<TEntity> GetDbSet<TEntity>() where TEntity : BaseEntity
+        {
+            var dbSet = _dbContext.Get<TEntity>();
+
+            return dbSet;
+        }
+
+        /// <summary>
+        /// Gets the current DbContext
+        /// </summary>
+        public AppendixObjectContext GetDbContext()
+        {
+            return (AppendixObjectContext)_dbContext;
+        }
+
+        #endregion
+    }
+}

+ 31 - 0
GreenTree.Nachtragsmanagement.Services/DbContext/IDbContextService.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using GreenTree.Nachtragsmanagement.Core;
+using GreenTree.Nachtragsmanagement.Data;
+
+namespace GreenTree.Nachtragsmanagement.Services.DbContext
+{
+    interface IDbContextService
+    {
+        /// <summary>
+        /// Checks if a DbSet exists in the curent DbContext
+        /// </summary>
+        /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
+        bool DbSetExists<TEntity>() where TEntity : BaseEntity;
+
+        /// <summary>
+        /// Get the DbSet of the corresponding Entity type
+        /// </summary>
+        /// <typeparam name="TEntity">The entity type of the DbSet.</typeparam>
+        IDbSet<TEntity> GetDbSet<TEntity>() where TEntity : BaseEntity;
+
+        /// <summary>
+        /// Gets the current DbContext
+        /// </summary>
+        AppendixObjectContext GetDbContext();
+    }
+}

+ 7 - 0
GreenTree.Nachtragsmanagement.Services/GreenTree.Nachtragsmanagement.Services.csproj

@@ -30,6 +30,7 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -40,9 +41,15 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DbContext\DbContextService.cs" />
+    <Compile Include="DbContext\IDbContextService.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Core\GreenTree.Nachtragsmanagement.Core.csproj">
+      <Project>{0b80c4a0-cb8f-423c-8af4-92b489c238dd}</Project>
+      <Name>GreenTree.Nachtragsmanagement.Core</Name>
+    </ProjectReference>
     <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Data\GreenTree.Nachtragsmanagement.Data.csproj">
       <Project>{0c45ecbc-6ad6-4eb1-89bb-f05a3f0fda13}</Project>
       <Name>GreenTree.Nachtragsmanagement.Data</Name>

+ 89 - 0
GreenTree.Nachtragsmanagement.Web.Framework/ApplicationContext.cs

@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autofac;
+using Autofac.Integration.Mvc;
+using GreenTree.Nachtragsmanagement.Data;
+using GreenTree.Nachtragsmanagement.Services.DbContext;
+
+namespace GreenTree.Nachtragsmanagement.Web.Framework
+{
+    public class ApplicationContext
+    {
+        #region Statics
+
+        /// <summary>
+        /// Current ApplicationContext
+        /// </summary>
+        private static ApplicationContext _current;
+
+        /// <summary>
+        /// Returns the current ApplicationContext or creates one if doesn't exist already
+        /// </summary>
+        public static ApplicationContext Current
+        {
+            get
+            {
+                if (_current == null)
+                {
+                    _current = new ApplicationContext();
+                }
+
+                return _current;
+            }
+        }
+
+        #endregion
+
+        #region Fields
+
+        /// <summary>
+        /// Returns the application wide container builder
+        /// </summary>
+        private static IContainer _appContainer;
+
+        #endregion
+
+        #region Services
+
+        /// <summary>
+        /// Returns the generel DbContextService
+        /// </summary>
+        public DbContextService DbContextService { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the ApplicationContext class
+        /// </summary>
+        public ApplicationContext()
+        {
+            DbContextService = new DbContextService(_appContainer.Resolve<IDbContext>());
+        }
+
+        #endregion
+
+        #region Initialization
+
+        /// <summary>
+        /// Registers all ressources needed by the ApplicationContext
+        /// </summary>
+        public static void Init()
+        {
+            var appBuilder = new ContainerBuilder();
+
+            appBuilder
+                .RegisterInstance(new AppendixObjectContext("Server=localhost\\SQLEXPRESS;Database=Nachtragsmanagement;User Id=nachtragdat;Password=nachtragdat;"))
+                .As<IDbContext>()
+                .SingleInstance();
+
+            _appContainer = appBuilder.Build();
+        }
+
+        #endregion
+    }
+}

+ 46 - 0
GreenTree.Nachtragsmanagement.Web.Framework/GreenTree.Nachtragsmanagement.Web.Framework.csproj

@@ -30,8 +30,36 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Autofac, Version=4.0.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
+      <HintPath>..\packages\Autofac.4.0.1\lib\net45\Autofac.dll</HintPath>
+    </Reference>
+    <Reference Include="Autofac.Integration.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
+      <HintPath>..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll</HintPath>
+    </Reference>
+    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.Helpers.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.Mvc.5.1.0\lib\net45\System.Web.Mvc.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.Razor.3.1.0\lib\net45\System.Web.Razor.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\packages\Microsoft.AspNet.WebPages.3.1.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
+    </Reference>
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
@@ -40,7 +68,25 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="ApplicationContext.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Singleton.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="NewFolder1\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Data\GreenTree.Nachtragsmanagement.Data.csproj">
+      <Project>{0c45ecbc-6ad6-4eb1-89bb-f05a3f0fda13}</Project>
+      <Name>GreenTree.Nachtragsmanagement.Data</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Services\GreenTree.Nachtragsmanagement.Services.csproj">
+      <Project>{7cc45abb-5398-49a2-85f5-966718afa7d8}</Project>
+      <Name>GreenTree.Nachtragsmanagement.Services</Name>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 87 - 0
GreenTree.Nachtragsmanagement.Web.Framework/Singleton.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Nachtragsmanagement.Web.Framework
+{
+    /// <summary>
+    /// A statically compiled "singleton" used to store objects throughout the 
+    /// lifetime of the app domain. Not so much singleton in the pattern's 
+    /// sense of the word as a standardized way to store single instances.
+    /// </summary>
+    /// <typeparam name="T">The type of object to store.</typeparam>
+    /// <remarks>Access to the instance is not synchrnoized.</remarks>
+    public class Singleton<T> : Singleton
+    {
+        static T instance;
+
+        /// <summary>The singleton instance for the specified type T. Only one instance (at the time) of this object for each type of T.</summary>
+        public static T Instance
+        {
+            get { return instance; }
+            set
+            {
+                instance = value;
+                AllSingletons[typeof(T)] = value;
+            }
+        }
+    }
+
+    /// <summary>
+    /// Provides a singleton list for a certain type.
+    /// </summary>
+    /// <typeparam name="T">The type of list to store.</typeparam>
+    public class SingletonList<T> : Singleton<IList<T>>
+    {
+        static SingletonList()
+        {
+            Singleton<IList<T>>.Instance = new List<T>();
+        }
+
+        /// <summary>The singleton instance for the specified type T. Only one instance (at the time) of this list for each type of T.</summary>
+        public new static IList<T> Instance
+        {
+            get { return Singleton<IList<T>>.Instance; }
+        }
+    }
+
+    /// <summary>
+    /// Provides a singleton dictionary for a certain key and vlaue type.
+    /// </summary>
+    /// <typeparam name="TKey">The type of key.</typeparam>
+    /// <typeparam name="TValue">The type of value.</typeparam>
+    public class SingletonDictionary<TKey, TValue> : Singleton<IDictionary<TKey, TValue>>
+    {
+        static SingletonDictionary()
+        {
+            Singleton<Dictionary<TKey, TValue>>.Instance = new Dictionary<TKey, TValue>();
+        }
+
+        /// <summary>The singleton instance for the specified type T. Only one instance (at the time) of this dictionary for each type of T.</summary>
+        public new static IDictionary<TKey, TValue> Instance
+        {
+            get { return Singleton<Dictionary<TKey, TValue>>.Instance; }
+        }
+    }
+
+    /// <summary>
+    /// Provides access to all "singletons" stored by <see cref="Singleton{T}"/>.
+    /// </summary>
+    public class Singleton
+    {
+        static Singleton()
+        {
+            allSingletons = new Dictionary<Type, object>();
+        }
+
+        static readonly IDictionary<Type, object> allSingletons;
+
+        /// <summary>Dictionary of type to singleton instances.</summary>
+        public static IDictionary<Type, object> AllSingletons
+        {
+            get { return allSingletons; }
+        }
+    }
+}

+ 9 - 0
GreenTree.Nachtragsmanagement.Web.Framework/packages.config

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Autofac" version="4.0.1" targetFramework="net452" />
+  <package id="Autofac.Mvc5" version="4.0.2" targetFramework="net452" />
+  <package id="Microsoft.AspNet.Mvc" version="5.1.0" targetFramework="net452" />
+  <package id="Microsoft.AspNet.Razor" version="3.1.0" targetFramework="net452" />
+  <package id="Microsoft.AspNet.WebPages" version="3.1.0" targetFramework="net452" />
+  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
+</packages>

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/App_Start/FilterConfig.cs

@@ -1,7 +1,7 @@
 using System.Web;
 using System.Web.Mvc;
 
-namespace GreenTree_Nachtragsmanagement_Web {
+namespace GreenTree.Nachtragsmanagement.Web {
     public class FilterConfig {
         public static void RegisterGlobalFilters(GlobalFilterCollection filters) {
             filters.Add(new HandleErrorAttribute());

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/App_Start/RouteConfig.cs

@@ -5,7 +5,7 @@ using System.Web;
 using System.Web.Mvc;
 using System.Web.Routing;
 
-namespace GreenTree_Nachtragsmanagement_Web {
+namespace GreenTree.Nachtragsmanagement.Web {
     public class RouteConfig {
         public static void RegisterRoutes(RouteCollection routes) {
             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/App_Start/WebApiConfig.cs

@@ -3,7 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Web.Http;
 
-namespace GreenTree_Nachtragsmanagement_Web {
+namespace GreenTree.Nachtragsmanagement.Web {
     public static class WebApiConfig {
         public static void Register(HttpConfiguration config) {
             config.Routes.MapHttpRoute(

+ 40 - 0
GreenTree.Nachtragsmanagement.Web/Controllers/HomeController.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+using GreenTree.Nachtragsmanagement.Web.Framework;
+using GreenTree.Nachtragsmanagement.Web.Models.User;
+
+namespace GreenTree.Nachtragsmanagement.Web.Controllers
+{
+    public class HomeController : Controller
+    {
+        // GET: Home
+        public ActionResult Index()
+        {
+            return View("~/Views/Home/Index.cshtml");
+        }
+
+        [HttpPost]
+        public ActionResult Index(UserModel model)
+        {
+            var userSet = ApplicationContext.Current.DbContextService.GetDbSet<Core.Domain.User.User>();
+            var dbContext = ApplicationContext.Current.DbContextService.GetDbContext();
+
+            var newUser = new Core.Domain.User.User
+            {
+                CustomId = model.CustomId,
+                Forename = model.Forename,
+                Lastname = model.Lastname,
+                MailAddress = model.MailAddress
+            };
+
+            userSet.Add(newUser);
+
+            dbContext.SaveChanges();
+
+            return View("~/Views/Home/Index.cshtml");
+        }
+    }
+}

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/Global.asax

@@ -1 +1 @@
-<%@ Application Codebehind="Global.asax.cs" Inherits="GreenTree_Nachtragsmanagement_Web.MvcApplication" Language="C#" %>
+<%@ Application Codebehind="Global.asax.cs" Inherits="GreenTree.Nachtragsmanagement.Web.MvcApplication" Language="C#" %>

+ 5 - 1
GreenTree.Nachtragsmanagement.Web/Global.asax.cs

@@ -5,8 +5,10 @@ using System.Web;
 using System.Web.Http;
 using System.Web.Mvc;
 using System.Web.Routing;
+using GreenTree.Nachtragsmanagement.Web.Framework;
+using GreenTree.Nachtragsmanagement.Core.Domain;
 
-namespace GreenTree_Nachtragsmanagement_Web
+namespace GreenTree.Nachtragsmanagement.Web
 {
     // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
     // visit http://go.microsoft.com/?LinkId=9394801
@@ -23,6 +25,8 @@ namespace GreenTree_Nachtragsmanagement_Web
             
             ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();
 
+            ApplicationContext.Init();
+
             DevExpress.Web.ASPxWebControl.CallbackError += Application_Error;
         }
 

+ 14 - 2
GreenTree.Nachtragsmanagement.Web/GreenTree.Nachtragsmanagement.Web.csproj

@@ -44,6 +44,9 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="Autofac, Version=4.0.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
+      <HintPath>..\packages\Autofac.4.0.1\lib\net45\Autofac.dll</HintPath>
+    </Reference>
     <Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
       <HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
     </Reference>
@@ -167,6 +170,7 @@
     <Content Include="Views\Shared\EditorTemplates\Password.cshtml" />
     <Content Include="Views\Shared\EditorTemplates\String.cshtml" />
     <Content Include="Views\Shared\EditorTemplates\EmailAddress.cshtml" />
+    <Content Include="Views\Home\Index.cshtml" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="Web.config" />
@@ -183,17 +187,25 @@
     <Compile Include="App_Start\FilterConfig.cs" />
     <Compile Include="App_Start\RouteConfig.cs" />
     <Compile Include="App_Start\WebApiConfig.cs" />
+    <Compile Include="Controllers\HomeController.cs" />
     <Compile Include="Global.asax.cs">
       <DependentUpon>Global.asax</DependentUpon>
     </Compile>
+    <Compile Include="Models\User\UserModel.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="App_Data\" />
-    <Folder Include="Controllers\" />
-    <Folder Include="Models\" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Core\GreenTree.Nachtragsmanagement.Core.csproj">
+      <Project>{0b80c4a0-cb8f-423c-8af4-92b489c238dd}</Project>
+      <Name>GreenTree.Nachtragsmanagement.Core</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Data\GreenTree.Nachtragsmanagement.Data.csproj">
+      <Project>{0c45ecbc-6ad6-4eb1-89bb-f05a3f0fda13}</Project>
+      <Name>GreenTree.Nachtragsmanagement.Data</Name>
+    </ProjectReference>
     <ProjectReference Include="..\GreenTree.Nachtragsmanagement.Services\GreenTree.Nachtragsmanagement.Services.csproj">
       <Project>{7cc45abb-5398-49a2-85f5-966718afa7d8}</Project>
       <Name>GreenTree.Nachtragsmanagement.Services</Name>

+ 15 - 0
GreenTree.Nachtragsmanagement.Web/Models/User/UserModel.cs

@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace GreenTree.Nachtragsmanagement.Web.Models.User
+{
+    public class UserModel
+    {
+        public int CustomId { get; set; }
+        public string Forename { get; set; }
+        public string Lastname { get; set; }
+        public string MailAddress { get; set; }
+    }
+}

+ 2 - 2
GreenTree.Nachtragsmanagement.Web/Properties/AssemblyInfo.cs

@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
 // General Information about an assembly is controlled through the following 
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("GreenTree_Nachtragsmanagement_Web")]
+[assembly: AssemblyTitle("GreenTree.Nachtragsmanagement.Web")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("GreenTree_Nachtragsmanagement_Web")]
+[assembly: AssemblyProduct("GreenTree.Nachtragsmanagement.Web")]
 [assembly: AssemblyCopyright("Copyright ? 2017")]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

+ 17 - 0
GreenTree.Nachtragsmanagement.Web/Views/Home/Index.cshtml

@@ -0,0 +1,17 @@
+@{
+    ViewBag.Title = "Index";
+    Layout = "~/Views/Shared/_Layout.cshtml";
+}
+
+@model GreenTree.Nachtragsmanagement.Web.Models.User.UserModel
+
+<h2>Benutzer anlegen</h2>
+
+@using (Html.BeginForm())
+{
+	<div>@Html.EditorFor(m => m.CustomId)</div>
+	<div>@Html.EditorFor(m => m.Forename)</div>
+	<div>@Html.EditorFor(m => m.Lastname)</div>
+	<div>@Html.EditorFor(m => m.MailAddress)</div>
+	<input type="submit" value="Speichern" />
+}

+ 1 - 1
GreenTree.Nachtragsmanagement.Web/Web.config

@@ -14,7 +14,7 @@
     </sectionGroup>
   </configSections>
   <connectionStrings>
-    <add name="DefaultConnection" connectionString="data source=(localdb)\mssqllocaldb;initial catalog=aspnet-GreenTree_Nachtragsmanagement_Web-20170723101623;integrated security=SSPI" providerName="System.Data.SqlClient" />
+    <add name="DefaultConnection" connectionString="data source=(localdb)\mssqllocaldb;initial catalog=aspnet-GreenTree.Nachtragsmanagement.Web-20170723101623;integrated security=SSPI" providerName="System.Data.SqlClient" />
   </connectionStrings>
   <appSettings>
     <add key="webpages:Version" value="3.0.0.0" />

+ 1 - 0
GreenTree.Nachtragsmanagement.Web/packages.config

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
+  <package id="Autofac" version="4.0.1" targetFramework="net452" />
   <package id="EntityFramework" version="6.1.3" targetFramework="net452" />
   <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
   <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />