public NHMetadataBuilder(ISessionFactory sessionFactory, IBreezeConfig breezeConfig, IBreezeConfigurator breezeConfigurator) { _sessionFactory = sessionFactory; _breezeConfig = breezeConfig; _breezeConfigurator = breezeConfigurator; _pluralizationService = new PluralizationServiceInstance(CultureInfo.GetCultureInfo("en-us")); }
/// <summary> /// Creates a new context using the session and metadata from the sourceContext /// </summary> /// <param name="sourceContext">source of the Session and metadata used by this new context.</param> /// <param name="eventPublisher">Used for publishing events</param> public BreezeContext(BreezeContext sourceContext, IEventPublisher eventPublisher) : base(sourceContext._breezeConfig) { _eventPublisher = eventPublisher; Session = sourceContext.Session; _breezeConfigurator = sourceContext._breezeConfigurator; _metadata = sourceContext.GetMetadata(); }
/// <summary> /// Create new instance with the given saveMap and fkMap. Since the saveMap is unique per save, /// this instance will be useful for processing one entire save bundle only. /// </summary> /// <param name="saveMap">Map of entity types -> entity instances to save. This is provided by Breeze in the SaveChanges call.</param> /// <param name="fkMap">Map of relationship name -> foreign key name. This is built in the NHBreezeMetadata class.</param> /// <param name="session">NHibernate session that will save the entities</param> /// <param name="breezeConfigurator"></param> public NhRelationshipFixer(Dictionary <Type, List <EntityInfo> > saveMap, IDictionary <string, string> fkMap, ISession session, IBreezeConfigurator breezeConfigurator) { this._saveMap = saveMap; this._fkMap = fkMap; this._session = session; this._breezeConfigurator = breezeConfigurator; this._dependencyGraph = new Dictionary <EntityInfo, List <EntityInfo> >(); }
public ValidatedBreezeContext( ISession session, IBreezeConfig breezeConfig, IBreezeConfigurator breezeConfigurator, IEventPublisher eventPublisher, Container container) : base(breezeConfig, session, breezeConfigurator, eventPublisher) { _container = container; }
/// <summary> /// Constructs an instance of <see cref="BreezeContractResolver"/>. /// </summary> public BreezeContractResolver( IBreezeConfigurator breezeConfigurator, IEntityMetadataProvider entityMetadataProvider, IClientModelMetadataProvider clientModelMetadataProvider, ILazyLoadGuardProvider lazyLoadGuardProvider) { _breezeConfigurator = breezeConfigurator; _entityMetadataProvider = entityMetadataProvider; _clientModelMetadataProvider = clientModelMetadataProvider; _lazyLoadGuardProvider = lazyLoadGuardProvider; }
/// <summary> /// Constructs an instance of <see cref="BreezeMetadataBuilder"/>. /// </summary> public BreezeMetadataBuilder( INHibernateClassMetadataProvider classMetadataProvider, IEntityMetadataProvider entityMetadataProvider, IBreezeConfigurator breezeConfigurator, IClientModelMetadataProvider clientModelMetadataProvider, IPropertyValidatorsProvider propertyValidatorsProvider, IDataTypeProvider dataTypeProvider) { _classMetadataProvider = classMetadataProvider; _entityMetadataProvider = entityMetadataProvider; _breezeConfigurator = breezeConfigurator; _clientModelMetadataProvider = clientModelMetadataProvider; _propertyValidatorsProvider = propertyValidatorsProvider; _dataTypeProvider = dataTypeProvider; }
private static void Configure(IBreezeConfigurator configurator) { configurator.ConfigureModelMembers(o => typeof(IClientModel).IsAssignableFrom(o), (member, o) => { if (member.GetCustomAttribute <NotNullAttribute>() != null) { o.IsNullable(false); } }); configurator.ConfigureModelMembers(o => typeof(IVersionedEntity).IsAssignableFrom(o), (member, o) => { if (VersionedEntityProperties.Contains(member.Name)) { o.IsNullable(true); o.Deserialize(false); } }); }
/// <summary> /// Creates a new context using the session and metadata from the sourceContext /// </summary> /// <param name="sourceContext">source of the Session and metadata used by this new context.</param> public NHContext(NHContext sourceContext) { this.session = sourceContext.Session; this.breezeConfigurator = sourceContext.breezeConfigurator; this._metadata = sourceContext.GetMetadata(); }
/// <summary> /// Create a new context for the given session. /// Each thread should have its own NHContext and Session. /// </summary> /// <param name="session">Used for queries and updates</param> /// <param name="breezeConfigurator">Used for get configurations</param> public NHContext(ISession session, IBreezeConfigurator breezeConfigurator) { this.session = session; this.breezeConfigurator = breezeConfigurator; }
public NHibernateContractResolver(Func <Type, IClassMetadata> getMetadataFunc, IBreezeConfigurator breezeConfigurator) { _breezeConfigurator = breezeConfigurator; _getMetadataFunc = getMetadataFunc; }
/// <summary> /// Create a new context for the given session. /// Each thread should have its own NHContext and Session. /// </summary> /// <param name="breezeConfig">Used for breeze config</param> /// <param name="session">Used for queries and updates</param> /// <param name="breezeConfigurator">Used for get configurations</param> /// <param name="eventPublisher">Used for publishing events</param> public BreezeContext(IBreezeConfig breezeConfig, ISession session, IBreezeConfigurator breezeConfigurator, IEventPublisher eventPublisher) : base(breezeConfig) { Session = session; _breezeConfigurator = breezeConfigurator; _eventPublisher = eventPublisher; }