BabelDbContextExtensions

Namespace: Babel.Data Assembly: Babel.Data.dll

A babel database context extensions.

public static class BabelDbContextExtensions

Inheritance

objectBabelDbContextExtensions

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Methods

Exists<T>(BabelDbContext, T)

An extension method that determine if an entity is in the local view.

public static bool Exists<T>(this BabelDbContext context, T entity) where T : class

Parameters

NameDescription

The context to act on.

entity T

The entity.

Returns

NameDescription

True if it succeeds, false if it fails.

Type Parameters

NameDescription

T

Generic type parameter.

IsAttached<T>(BabelDbContext, T)

An extension method that query if an entity is attached.

public static bool IsAttached<T>(this BabelDbContext context, T entry) where T : class

Parameters

NameDescription

The context to act on.

entry T

The entry.

Returns

NameDescription

True if the entry is attached, false if not.

Type Parameters

NameDescription

T

Generic type parameter.

IsDetached<T>(BabelDbContext, T)

An extension method that query an entity is detached.

public static bool IsDetached<T>(this BabelDbContext context, T entry) where T : class

Parameters

NameDescription

The context to act on.

entry T

The entry.

Returns

NameDescription

True if the entry is detached, false if not.

Type Parameters

NameDescription

T

Generic type parameter.

TryAttach<T>(BabelDbContext, DbSet<T>, T)

An extension method that attempts to attach.

public static bool TryAttach<T>(this BabelDbContext context, DbSet<T> collection, T entry) where T : class

Parameters

NameDescription

The context to act on.

collection DbSet<T>

The collection.

entry T

The entry.

Returns

NameDescription

True if it succeeds, false if it fails.

Type Parameters

NameDescription

T

Generic type parameter.

Last updated