Exemplo n.º 1
0
        public RepositoryContainer()
        {
            entityContext = new StokContext(InternalConfiguration.Instance.GetEntityFrameworkConnectionString());
            entityContext.Database.Log = msg => logger.Debug("EF Debug: {0}", msg);

            this.itemRepository = new ItemRepository(entityContext);
            this.actionRepository = new ActionRepository(entityContext);
            this.expenseRepository = new ExpenseRepository(entityContext);

            Mapper.CreateMap<Item, Entities.Item>().ReverseMap().IgnoreAllPropertiesWithAnInaccessibleSetter();
            Mapper.CreateMap<ActionLog, Entities.ActionLog>().ReverseMap().IgnoreAllPropertiesWithAnInaccessibleSetter();
            Mapper.CreateMap<ItemProperty, Entities.ItemProperty>().ReverseMap().IgnoreAllPropertiesWithAnInaccessibleSetter();
            Mapper.CreateMap<Expense, Entities.Expense>().ReverseMap().IgnoreAllPropertiesWithAnInaccessibleSetter();
        }
Exemplo n.º 2
0
 public RepositoryBase(StokContext context)
 {
     this.context = context;
 }
Exemplo n.º 3
0
 public ItemRepository(StokContext context)
     : base(context)
 {
 }
Exemplo n.º 4
0
 public ExpenseRepository(StokContext context)
     : base(context)
 {
 }
Exemplo n.º 5
0
 public ActionRepository(StokContext context)
     : base(context)
 {
 }