当前位置: 首页>>代码示例>>C#>>正文


C# DomainContext类代码示例

本文整理汇总了C#中DomainContext的典型用法代码示例。如果您正苦于以下问题:C# DomainContext类的具体用法?C# DomainContext怎么用?C# DomainContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DomainContext类属于命名空间,在下文中一共展示了DomainContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NewInvocationContextIsConfiguredCorrectly

 public void NewInvocationContextIsConfiguredCorrectly()
 {
     var configuration = new DomainConfiguration();
     configuration.EnsureCommitted();
     var domainContext = new DomainContext(configuration);
     var context = new InvocationContext(domainContext);
     Assert.Same(domainContext, context.DomainContext);
 }
开发者ID:jeeshenlee,项目名称:RESTier,代码行数:8,代码来源:InvocationContext.Tests.cs

示例2: ReinitializeDatabase

 private static IUnitOfWork ReinitializeDatabase(DomainContext dbContext)
 {
     // force to single_user so that we can drop the database in order to prevent this error: "database is currently in use ..."
     dbContext.Database.ExecuteSqlCommand(string.Format("ALTER DATABASE {0} SET SINGLE_USER WITH ROLLBACK IMMEDIATE", Fixture.DatabaseName));
     new DatabaseInitializer().InitializeDatabase(dbContext);
     return new UnitOfWork(dbContext);
 }
开发者ID:ptran123,项目名称:Conceptual,代码行数:7,代码来源:Fixture.cs

示例3: WhenHandlerRegistered_ThenCanProcessEntity

		public void WhenHandlerRegistered_ThenCanProcessEntity()
		{
			var id = Guid.NewGuid();
			var product = new Product(id, "DevStore");

			var context = default(IDomainContext);
			var eventStream = new EventStream();
			IDomainEventStore store = new ConsoleEventStore();

			// Keep the handlers so they are not GC'ed.
			var handlers = new object[]
			{ 
				new ConsoleHandler(eventStream), 
				new SendMailHandler(eventStream),
			};

			context = new DomainContext(eventStream, store);
			context.Save(product);

			// Save changes and cause publication of pending events 
			// in the newly created domain object.
			context.SaveChanges();

			Console.WriteLine();

			// Here some command might pull the product from the 
			// context, and invoke a domain method.
			var savedProduct = context.Find<Product>(id);
			product.Publish(1);

			// Saving again causes persistence of the entity state 
			// as well as publishing the events.
			context.SaveChanges();
		}
开发者ID:netfx,项目名称:extensions,代码行数:34,代码来源:Program.cs

示例4: GetAll

 public IEnumerable<Person> GetAll()
 {
     var context = new DomainContext(this.ConnectionString);
     return context.Persons.Include("AssignedSymptoms").Include("FirstPersonPersons");/*.Include("SecondPersonPersons").Include("PersonContacts").Include("AssignedRiskFactors")
         .Include("Credentials").Include("PersonGroups").Include("PersonOperations").Include("PersonDiseases").Include("PersonAllergicReactions")
         .Include("ConsultationsAsDoctor").Include("ConsultationsAsPatient").Include("PersonHospitalizations");*/
 }
开发者ID:Reverti,项目名称:InfoMed,代码行数:7,代码来源:PersonRepository.cs

示例5: Start

        /// <summary>
        /// Creates a new DomainContext and starts its processors, using the previously applied configurations.
        /// </summary>
        /// <returns>A new DomainContext</returns>
        public IDomainContext Start()
        {
            if (this.Configuring != null)
            {
                this.Configuring(this);
            }

            var context = new DomainContext(this.EventStore.Value,
                                            new EventBus(this.MessageBus.Value),
                                            new CommandBus(this.MessageBus.Value),
                                            this.Processors.Value,
                                            this.LoggerFactory.Value,
                                            this.Resolver.Value);

            if (this.Configured != null)
            {
                this.Configured(context);
            }

            this.Configuring = null;
            this.Configured = null;

            context.StartProcessors();

            return context;
        }
开发者ID:mfelicio,项目名称:NDomain,代码行数:30,代码来源:ContextBuilder.cs

示例6: GetAll

 public IEnumerable<PersonConsultation> GetAll()
 {
     var context = new DomainContext(this.ConnectionString);
     return context.PersonConsultations.Include("Doctor").Include("Patient").Include("ConsultationType").Include("PersonConsultationResearches")
         .Include("PersonConsultationLabAnalyzes").Include("PersonConsultationSymptoms").Include("PersonConsultationComplaints")
         .Include("PersonConsultationMeasurings").Include("PersonConsultationDiagnosises").Include("AssignedMedicaments").Include("AssignedMeasurings");
 }
开发者ID:Reverti,项目名称:InfoMed,代码行数:7,代码来源:PersonConsultationRepository.cs

示例7: Modify

 public void Modify(DomainContext context)
 {
     EntitySet<MockUser> users = context.EntityContainer.GetEntitySet<MockUser>();
     if (!users.Contains(this))
     {
         users.Attach(this);
     }
     this.RaiseDataMemberChanging("MutableProperty");
     this.MutableProperty++;
     this.RaiseDataMemberChanged("MutableProperty");
 }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:11,代码来源:AuthenticationDomainClient.cs

示例8: GetEntitiesByQuery

        public IEnumerable<HospitalDepartment> GetEntitiesByQuery(Func<HospitalDepartment, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.HospitalDepartments.Include("Hospital").Include("PersonHospitalizations").Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:HospitalDepartmentRepository.cs

示例9: ChangeSentTimeout

        public static void ChangeSentTimeout(DomainContext aContext, TimeSpan aSendTimeout)
        {
            PropertyInfo lChangeFactoryProperty = aContext.DomainClient.GetType().GetProperty("ChannelFactory");
            if (lChangeFactoryProperty == null)
            {
                throw new InvalidOperationException("There is no ChannelFactory property on the DomainClient.");
            }

            ChannelFactory lFactory = (ChannelFactory)lChangeFactoryProperty.GetValue(aContext.DomainClient, null);
            lFactory.Endpoint.Binding.ReceiveTimeout = aSendTimeout;
            lFactory.Endpoint.Binding.ReceiveTimeout = aSendTimeout;
        }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:12,代码来源:TimeoutUtility.cs

示例10: GetEntitiesByQuery

        public IEnumerable<PersonConsultationLabAnalyze> GetEntitiesByQuery(Func<PersonConsultationLabAnalyze, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.PersonConsultationLabAnalyzes.Include("LabAnalyzeType").Include("PersonConsultation").Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:PersonConsultationLabAnalyzeRepository.cs

示例11: GetEntitiesByQuery

        public IEnumerable<AssignedRiskFactor> GetEntitiesByQuery(Func<AssignedRiskFactor, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.AssignedRiskFactors.Include("Person").Include("RiskFactor").Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:AssignedRiskFactorRepository.cs

示例12: GetEntitiesByQuery

        public IEnumerable<OnceRiskFactorNotification> GetEntitiesByQuery(Func<OnceRiskFactorNotification, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.OnceRiskFactorNotifications.Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:OnceRiskFactorNotificationRepository.cs

示例13: GetEntitiesByQuery

        public IEnumerable<PersonAllergicReaction> GetEntitiesByQuery(Func<PersonAllergicReaction, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.PersonAllergicReactions.Include("Person").Include("AllergicReaction").Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:PersonAllergicReactionRepository.cs

示例14: GetEntitiesByQuery

        public IEnumerable<Research> GetEntitiesByQuery(Func<Research, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.Researches.Include("PersonConsultationResearches").Where(query).ToList();
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:ResearchRepository.cs

示例15: GetEntitiesByQuery

        public IEnumerable<AsignedSymptom> GetEntitiesByQuery(Func<AsignedSymptom, bool> query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            using (var context = new DomainContext(this.ConnectionString))
            {
                return context.AsignedSymptoms.Include("Person").Include("Symptom").Where(query);
            }
        }
开发者ID:Reverti,项目名称:InfoMed,代码行数:12,代码来源:AsignedSymptomRepository.cs


注:本文中的DomainContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。