Castle.Facilities.NHibernateIntegration
Defines size, enumerators, and synchronization methods for strongly
typed collections of elements.
IFieldInfoCollection
provides an that is strongly typed for
elements.
Copies the entire
to a one-dimensional
of elements,
starting at the specified index of the target array.
The one-dimensional that is the destination
of the elements copied
from the .
The Array must have zero-based indexing.
The zero-based index in
at which copying begins.
is a null reference.
is less than zero.
is equal to or
greater than the length of .
-or-
The number of elements in the source
is greater
than the available space from
to the end of the destination .
Please refer to for details.
Returns an that can
iterate through the .
An for the entire
.
Please refer to
for details.
Gets the number of elements contained in the
.
The number of elements contained in the
.
Please refer to for details.
Gets a value indicating whether access to the
is synchronized (thread-safe).
true if access to the
is synchronized (thread-safe); otherwise, false.
The default is false.
Please refer to
for details.
Gets an object that can be used to synchronize access to the
.
An object that can be used to synchronize access to the
.
Please refer to for details.
Represents a strongly typed collection
of objects
that can be individually accessed by index.
IFieldInfoList
provides an that is strongly typed for
elements.
Adds a to the end
of the .
The object to be added
to the end of the .
This argument may be a null reference.
The index at which
the has been added.
The is read-only.
-or-
The IFieldInfoList has a fixed size.
Please refer to for details.
Removes all elements from the
.
The is read-only.
-or-
The IFieldInfoList has a fixed size.
Please refer to for details.
Determines whether the
contains the specified element.
The object to locate
in the .
This argument may be a null reference.
true if is found in the
; otherwise, false.
Please refer to for details.
Returns the zero-based index of the first occurrence
of the specified
in the .
The object to locate
in the .
This argument may be a null reference.
The zero-based index of the first occurrence of the specified
in the ,
if found; otherwise, -1.
Please refer to for details.
Inserts a element into the
at the specified index.
The zero-based index at which
should be inserted.
The object to insert
into the .
This argument may be a null reference.
is less than zero.
-or-
is greater than
.
The is read-only.
-or-
The IFieldInfoList has a fixed size.
Please refer to for details.
Removes the first occurrence of the specified
from the
.
The object to remove
from the .
This argument may be a null reference.
The is read-only.
-or-
The IFieldInfoList has a fixed size.
Please refer to for details.
Removes the element at the specified index of the
.
The zero-based index of the element to remove.
is less than zero.
-or-
is equal to or greater than
.
The is read-only.
-or-
The IFieldInfoList has a fixed size.
Please refer to for details.
Gets a value indicating whether the
has a fixed size.
true if the
has a fixed size; otherwise, false.
The default is false.
Please refer to for details.
Gets a value indicating whether the
is read-only.
true if the
is read-only; otherwise, false.
The default is false.
Please refer to for details.
Gets or sets the
element at the specified index.
The zero-based index of the
element to get or set.
The element
at the specified .
is less than zero.
-or-
is equal to or greater than
.
The property is set, and the
is read-only.
Please refer to for details.
Supports type-safe iteration over a collection that contains
elements.
IFieldInfoEnumerator
provides an that is strongly typed for
elements.
Advances the enumerator to the next element of the collection.
true if the enumerator was successfully advanced
to the next element; false if the enumerator has
passed the end of the collection.
The collection was modified after the enumerator was created.
Please refer to for details.
Sets the enumerator to its initial position,
which is before the first element in the collection.
The collection was modified after the enumerator was created.
Please refer to for details.
Gets the current
element in the collection.
The current
element in the collection.
The enumerator is positioned before the first element
of the collection or after the last element.
-or-
The collection was modified after the enumerator was created.
Please refer to for details,
but note that Current fails if the collection was modified
since the last successful call to or
.
Implements a strongly typed collection
of elements.
FieldInfoCollection
provides an that is strongly typed for
elements.
The property
of the class can be used as a key
to locate elements in the FieldInfoCollection.
The collection may contain multiple identical keys. All key access
methods return the first occurrence of the specified key, if found.
Access by key is an O(N) operation, where N is the
current value of the property.
Initializes a new instance of the
class
with the specified data container.
The object to share with another instance.
This constructor is used to create read-only wrappers.
Initializes a new instance of the
class.
Initializes a new instance of the
class
that is empty and has the default initial capacity.
Please refer to for details.
Initializes a new instance of the
class
that is empty and has the specified initial capacity.
The initial number of elements that the new
can contain.
is less than zero.
Please refer to for details.
Initializes a new instance of the
class that
contains elements copied from the specified collection and that
has the same initial capacity as the number of elements copied.
The
whose elements are copied to the new collection.
is a null reference.
Please refer to for details.
Initializes a new instance of the
class
that contains elements copied from the specified
array and that has the
same initial capacity as the number of elements copied.
An of
elements that are copied to the new collection.
is a null reference.
Please refer to for details.
Adds a to the end
of the .
The object to be added
to the end of the .
This argument may be a null reference.
The
index at which the has been added.
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection
already contains ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Adds an to the end of the
.
The object to be added to the end of the
. This argument
must be compatible with .
This argument may be a null reference.
The
index at which the has been added.
is not compatible with
.
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection
already contains ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Adds a range of elements to the end of the
.
Adds the elements of another collection to the end of the
.
The whose elements
should be added to the end of the current collection.
is a null reference.
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection already contains one
or more elements in ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Adds the elements of a array
to the end of the .
An of
elements that should be added to the end of the
.
is a null reference.
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection already contains
one or more elements in ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Uses a binary search algorithm to locate a specific element
in the sorted
or a portion of it.
Searches the entire sorted
for an element using the
specified comparer and returns the zero-based index of the element.
The object to locate
in the .
This argument may be a null reference.
The implementation
to use when comparing elements.
-or-
A null reference to use the
implementation of each element.
The zero-based index of in the sorted
, if
is found; otherwise, a negative number, which is the bitwise
complement of the index of the next element that is larger than
or, if there is no larger element, the
bitwise complement of .
is a null reference,
and FieldInfo does not implement
the interface.
Please refer to
for details.
Searches a section of the sorted
for an
element using the
specified comparer and returns the zero-based index of the element.
The zero-based starting index of the range of elements to search.
The number of elements to search.
The object to locate
in the .
This argument may be a null reference.
The implementation
to use when comparing elements.
-or-
A null reference to use the
implementation of each element.
The zero-based index of in the sorted
, if
is found; otherwise, a negative number, which is the bitwise
complement of the index of the next element that is larger than
or, if there is no larger element, the
bitwise complement of .
and
do not denote a valid range of elements in the
.
-or-
is a null reference,
and FieldInfo does not implement
the interface.
is less than zero.
-or-
is less than zero.
Please refer to
for details.
Removes all elements from the .
The
is read-only or has a fixed size.
Please refer to for details.
Creates a shallow copy of the .
A shallow copy of the .
Please refer to for details.
Determines whether the
contains the specified element.
The object to locate
in the .
This argument may be a null reference.
true if is found in the
; otherwise, false.
Please refer to for details.
Determines whether the
contains the specified element.
The object to locate in the
. This argument
must be compatible with .
This argument may be a null reference.
true if is found in the
; otherwise, false.
is not compatible with
.
Please refer to for details.
Determines whether the contains
the specified value.
The value to locate
in the .
This argument may be a null reference.
true if is found in the
; otherwise, false.
ContainsKey is similar to but
compares the specified to the value
of the property
of each element, rather than
to the element itself.
Copies the
or a portion of it to a one-dimensional array.
Copies the entire
to a one-dimensional
of elements,
starting at the beginning of the target array.
The one-dimensional that is the destination
of the elements copied from the
.
The Array must have zero-based indexing.
is a null reference.
The number of elements in the source
is greater than
the available space in the destination .
Please refer to for details.
Copies the entire
to a one-dimensional
of elements,
starting at the specified index of the target array.
The one-dimensional that is the destination
of the elements copied from the
.
The Array must have zero-based indexing.
The zero-based index in
at which copying begins.
is a null reference.
is less than zero.
is equal to or
greater than the length of .
-or-
The number of elements in the source
is greater
than the available space from
to the end of the destination .
Please refer to for details.
Copies the entire
to a one-dimensional ,
starting at the specified index of the target array.
The one-dimensional that is the destination
of the elements copied from the
.
The Array must have zero-based indexing.
The zero-based index in
at which copying begins.
is a null reference.
is less than zero.
is multidimensional.
-or-
is equal to or
greater than the length of .
-or-
The number of elements in the source
is greater
than the available space from
to the end of the destination .
cannot be cast automatically to the type of the destination
.
Please refer to for details.
Gets the element
associated with the first occurrence of the specified
value.
The
value whose element to get.
This argument may be a null reference.
The element associated
with the first occurrence of the specified
, if found; otherwise,
a null reference.
GetByKey compares the specified
to the value of the
property of each element,
and returns the first matching element.
Returns an that can
iterate through the .
An for the entire
.
Please refer to for details.
Returns an that can iterate through the
.
An for the entire
.
Please refer to for details.
Returns the zero-based index of the first occurrence
of the specified in the
.
The object
to locate in the .
This argument may be a null reference.
The zero-based index of the first occurrence of
in the ,
if found; otherwise, -1.
Please refer to for details.
Returns the zero-based index of the first occurrence
of the specified in the
.
The object to locate in the .
This argument must be compatible with .
This argument may be a null reference.
The zero-based index of the first occurrence of
in the ,
if found; otherwise, -1.
is not compatible with
.
Please refer to for details.
Returns the zero-based index of the first occurrence of the
specified value
in the .
The value
to locate in the .
This argument may be a null reference.
The zero-based index of the first occurrence of
in the ,
if found; otherwise, -1.
IndexOfKey is similar to but
compares the specified to the value
of the property
of each element, rather than
to the element itself.
Inserts a element into the
at the specified index.
The zero-based index at which
should be inserted.
The object to insert
into the .
This argument may be a null reference.
is less than zero.
-or-
is greater than .
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection
already contains ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Inserts an element into the
at the specified index.
The zero-based index at which
should be inserted.
The object to insert into the .
This argument must be compatible with .
This argument may be a null reference.
is less than zero.
-or-
is greater than .
is not compatible with .
The
is read-only or has a fixed size.
-or-
The FieldInfoCollection
already contains ,
and the FieldInfoCollection
ensures that all elements are unique.
Please refer to for details.
Returns a read-only wrapper for the specified
.
The to wrap.
A read-only wrapper around .
is a null reference.
Please refer to for details.
Removes the first occurrence of the specified
from the
.
The object to remove
from the .
This argument may be a null reference.
The
is read-only or has a fixed size.
Please refer to for details.
Removes the first occurrence of the specified
from the .
The object to remove from the
. This argument
must be compatible with .
This argument may be a null reference.
is not compatible with
.
The
is read-only or has a fixed size.
Please refer to for details.
Removes the element at the specified index of the
.
The zero-based index of the element to remove.
is less than zero.
-or-
is equal to or
greater than .
The
is read-only or has a fixed size.
Please refer to for details.
Removes the specified range of elements from the
.
The zero-based starting index of the range of elements to remove.
The number of elements to remove.
and
do not denote a valid range of elements in the
.
is less than zero.
-or-
is less than zero.
The
is read-only or has a fixed size.
Please refer to for details.
Reverses the order of the elements in the
or a portion of it.
Reverses the order of the elements in the entire
.
The is read-only.
Please refer to for details.
Reverses the order of the elements in the specified range.
The zero-based starting index of the range of elements to reverse.
The number of elements to reverse.
and
do not denote a valid range of elements in the
.
is less than zero.
-or-
is less than zero.
The is read-only.
Please refer to for details.
Sorts the elements in the
or a portion of it.
Sorts the elements in the entire
using the implementation of each element.
The is read-only.
One or more elements in the
do not implement the interface.
Please refer to for details.
Sorts the elements in the entire
using the specified comparer.
The implementation
to use when comparing elements.
-or-
A null reference to use the
implementation of each element.
The is read-only.
Please refer to
for details.
Sorts the elements in the specified range
using the specified comparer.
The zero-based starting index of the range of elements to sort.
The number of elements to sort.
The implementation
to use when comparing elements.
-or-
A null reference to use the
implementation of each element.
and
do not denote a valid range of elements in the
.
is less than zero.
-or-
is less than zero.
The is read-only.
Please refer to
for details.
Copies the elements of the
to a new of
elements.
A one-dimensional of
elements containing copies of the
elements of the .
Please refer to for details.
Sets the capacity to the actual number of elements in the
.
The
is read-only or has a fixed size.
Please refer to for details.
Gets or sets the capacity of the .
The number of elements that the
can contain.
Capacity is set to a value that is
less than .
The property is set, and the
is read-only or has a fixed size.
Please refer to for details.
Gets the number of elements contained in the
.
The number of elements contained in the
.
Please refer to for details.
Gets a value indicating whether the
has a fixed size.
true if the
has a fixed size; otherwise, false.
The default is false.
Please refer to for details.
Gets a value indicating whether the
is read-only.
true if the
is read-only; otherwise, false.
The default is false.
Please refer to for details.
Gets a value indicating whether access to the
is synchronized (thread-safe).
true if access to the
is synchronized (thread-safe); otherwise, false.
The default is false.
Please refer to for details.
Gets or sets a value indicating whether the
ensures that all elements are unique.
true if the
ensures that all elements are unique; otherwise,
false. The default is false.
The property is set to true, and the
already contains duplicate elements.
The property is set, and the
is read-only.
IsUnique provides a set-like collection by ensuring that
all elements in the
are unique.
When changed to true, this property throws an
if the
FieldInfoCollection already contains duplicate
elements. Any subsequent attempt to add an element that is
already contained in the FieldInfoCollection
will cause a .
Gets or sets the
element at the specified index.
The zero-based index of the
element to get or set.
The element
at the specified .
is less than zero.
-or-
is equal to or
greater than .
The property is set, and the
is read-only.
-or-
The property is set, the FieldInfoCollection
already contains the specified element at a different index,
and the FieldInfoCollection ensures
that all elements are unique.
Please refer to for details.
Gets or sets the element at the specified index.
The zero-based index of the element to get or set.
The element at the specified .
When the property is set, this value must be compatible
with .
is less than zero.
-or-
is equal to
or greater than .
The property is set to a value that is not compatible
with .
The property is set, and the
is read-only.
-or-
The property is set, the FieldInfoCollection
already contains the specified element at a different index,
and the FieldInfoCollection ensures
that all elements are unique.
Please refer to for details.
Gets an object that can be used to synchronize access to the
.
An object that can be used to synchronize access to the
.
Please refer to for details.
Summary description for ReflectionUtil.
Gets the property value.
obj.
Property.
Gets the PropertyInfo thus named.
obj.
Property.
Gets the FieldInfo thus named
obj.
Field.
Check if the property is not null and can be read and is no indexed.
This is done to know if it can be read safely.
Obj.
Prop.
Determines whether type is simple enough to need just ToString()
to show its state.
(string,int, bool, enums are simple.
Anything else is false.
Determines whether the object is simple.
An object is simple if its type is simple or if it's null.
Gets the name of an object.
The name of the object is it's type name or the value of
its Name property or field
Gets the field value from object, and return
Gets the value of the object, if the object is simple, the returned string is
the object ToString(), otherwise, it's the object name (if it has one) or the object type.
Gets all the fields from the object's type with specified attribute
Converts from string to the type.
Can covert from string, enums booleans, bytes, int32 and datetime
Text.
Type.
Gets all the fields WITHOUT ANY of the specified attributes.
Gets the value of a property or field name in the object.
Or return empty string if there aren't any.
Sets the name property or value of an object to the value of name.
Does nothing if the object doesn't have any fields or properties named 'name'
Gets the readable (non indexed) properties names and values.
The keys holds the names of the properties.
The values are the values of the properties
Gets the fields names and values.
The keys holds the names of the fields.
The values hold the value of the field if it's a simple type,
or the name of the field's type.
An object has value if it's not null,
an collection containing elements and a non-empty string
Summary description for DataException.
Contributed by Steve Degosserie <steve.degosserie@vn.netika.com>
Summary description for IGenericDao.
Contributed by Steve Degosserie <steve.degosserie@vn.netika.com>
Summary description for INHibernateGenericDao.
Contributed by Steve Degosserie <steve.degosserie@vn.netika.com>
Summary description for GenericDao.
Contributed by Steve Degosserie <steve.degosserie@vn.netika.com>
HttpModule to set up a session for the request lifetime.
To install the module, you must:
-
Add the module to the httpModules configuration section within system.web
-
Extend the if you haven't
-
Make your HttpApplication subclass implement
so the module can access the container instance
Provides the contract for implementors who want to
store valid session so they can be reused in a invocation
chain.
Should return a previously stored session
for the given alias if available, otherwise null.
Should store the specified session instance
Should remove the session from the store
only.
Returns true if the current activity
(which is an execution activity context) has no
sessions available
Provides an implementation of
which relies on CallContext
Provides a bridge to NHibernate allowing the implementation
to cache created session (through an invocation) and
enlist it on transaction if one is detected on the thread.
Returns a valid opened and connected ISession instance
Returns a valid opened and connected ISession instance
for the given connection alias.
The flushmode the created session gets
Initializes a new instance of the class.
The session store.
The kernel.
The factory resolver.
Dictates the contract for possible different approach
of session factories obtention.
Inspired on Cuyahoga project
Invoked by the facility while the configuration
node are being interpreted.
The alias associated with the session factory on the configuration node
The component key associated with the session factory on the kernel
Implementors should return a session factory
instance for the specified alias configured previously.
The alias associated with the session factory on the configuration node
A session factory instance
If the alias is not associated with a session factory
Adapter to so a
NHibernate transaction can be enlisted within
instances.
Proxies an ISession so the user cannot close a session which
is controlled by a transaction, or, when this is not the case,
make sure to remove the session from the storage.
Default implementation of
that always queries the kernel instance for the session factory instance.
This gives a chance to developers replace the session factory instance
during the application lifetime.
Inspired on Cuyahoga project
Constructs a SessionFactoryResolver
Kernel instance supplied by the container itself
Associated the alias with the component key
The alias associated with the session
factory on the configuration node
The component key associated with
the session factory on the kernel
Returns a session factory instance associated with the
specified alias.
The alias associated with the session
factory on the configuration node
A session factory instance
If the alias is not associated with a session factory
Provides an implementation of
which relies on HttpContext. Suitable for web projects.
Exposes constants used by the facility and its internal
components
Provides a basic level of integration with the NHibernate project
This facility allows components to gain access to the NHibernate's
objects:
- NHibernate.Cfg.Configuration
- NHibernate.ISessionFactory
It also allow you to obtain the ISession instance
through the component , which is
transaction aware and save you the burden of sharing session
or using a singleton.
The following sample illustrates how a component
can access the session.
public class MyDao
{
private ISessionManager sessionManager;
public MyDao(ISessionManager sessionManager)
{
this.sessionManager = sessionManager;
}
public void Save(Data data)
{
using(ISession session = sessionManager.OpenSession())
{
session.Save(data);
}
}
}
Reads the attribute useReflectionOptimizer and configure
the reflection optimizer accordingly.
As reported on Jira (FACILITIES-39) the reflection optimizer
slow things down. So by default it will be disabled. You
can use the attribute useReflectionOptimizer to turn it
on.
If has a reference on
NHibernate.Mapping.Attributes : use the NHibernate mapping
attributes contained in that assembly to update NHibernate
configuration (). Else do nothing
To avoid an unnecessary dependency on the library
NHibernate.Mapping.Attributes.dll when using this
facility without NHibernate mapping attributes, all calls to that
library are made using reflexion.
NHibernate configuration
Target assembly name