ABP源碼分析十五:ABP中的實用擴展方法


類名

擴展的類型

方法名

參數

作用

XmlNodeExtensions

XmlNode

GetAttributeValueOrNull

attributeName

Gets an   attribute's value from an Xml node.

JsonExtensions

object

ToJsonString

bool   camelCase

bool   indented

Converts   given object to JSON string.

StreamExtensions

Stream

GetAllBytes

 

Get all   bytes from a steam

LockExtensions

object

Locking

Action

Executes   given action by locking given source object.

LockExtensions

T

Locking<T>

Action<T>

Executes   given action by locking given source object.

LockExtensions

object

Locking<TResult>

Func<TResult>

Executes   given func and returns it's value by locking given source object.

LockExtensions

T

Locking<T,   TResult>

Func<T,   TResult>

Executes   given func and returns it's value by locking given source object.

IsolationLevelExtensions

System.Transactions.IsolationLevel

ToSystemDataIsolationLevel

NA

Converts   System.Transactions.IsolationLevel to System.Data.IsolationLevel

QueryableExtensions

IQueryable

IncludeIf

bool   condition, string path

Specifies   the related objects to include in the query results.

QueryableExtensions

IQueryable<T>

IncludeIf<T>

bool   condition, string path

Specifies   the related objects to include in the query results.

QueryableExtensions

IQueryable<T>

IncludeIf<T,   TProperty>

bool   condition, Expression<Func<T, TProperty>> path

Specifies   the related objects to include in the query results.

DbContextExtensions

Type

GetEntityTypes

NA

獲取DbContext中的所有entity類型

MemberInfoExtensions

MemberInfo

GetSingleAttributeOrNull<T>

bool   inherit

Gets a   single attribute for a member.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM