Exemple #1
0
        public CosmosDb() : base(new AzCosmos.CosmosClient("https://localhost:8081", "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="), "Beef.UnitTest", true)
        {
            _mapper = new AutoMapper.Mapper(new MapperConfiguration(c =>
            {
                c.AddProfile <Mapper.AutoMapperProfile>();
                c.CreateMap <Person1, Person1>();
                c.CreateMap <Person2, Person2>();
                c.CreateMap <Person3, Person3>();
            }));

            Persons1 = new CosmosDbContainer <Person1, Person1>(this, CosmosDbArgs.Create(_mapper, "Persons1"));
            Persons2 = new CosmosDbContainer <Person2, Person2>(this, CosmosDbArgs.Create(_mapper, "Persons2"));
            Persons3 = new CosmosDbValueContainer <Person3, Person3>(this, CosmosDbArgs.Create(_mapper, "Persons3"));
        }
Exemple #2
0
 public CosmosDb() : base(new AzCosmos.CosmosClient("https://localhost:8081", "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="), "Beef.UnitTest", true)
 {
     Persons1 = new CosmosDbContainer <Person1, Person1>(this, CosmosDbMapper.CreateAuto <Person1, Person1>().HasProperty(s => s.Id, d => d.Id, p => p.SetUniqueKey()).CreateArgs("Persons1"));
     Persons2 = new CosmosDbContainer <Person2, Person2>(this, CosmosDbMapper.CreateAuto <Person2, Person2>().HasProperty(s => s.Id, d => d.Id, p => p.SetUniqueKey()).CreateArgs("Persons2"));
     Persons3 = new CosmosDbValueContainer <Person3, Person3>(this, CosmosDbMapper.CreateAuto <Person3, Person3>().HasProperty(s => s.Id, d => d.Id, p => p.SetUniqueKey()).CreateArgs("Persons3"));
 }