AppUtils
Common High-level App utils covering popular App scenarios
Assembly: ServiceStack.dll
View Source
Declaration
public static class AppUtils : object
Methods
NewScope<T>(IServiceProvider, Func<IServiceScope, T>)
View Source
Declaration
public static T NewScope<T>(this IServiceProvider services, Func<IServiceScope, T> fn)
Returns
<T>
Parameters
Type | Name |
---|---|
IServiceProvider | services |
Func<IServiceScope,<T>> | fn |
Type Parameters
T
DbContextExec<TApplicationDbContext, T>(IServiceProvider, Func<TApplicationDbContext, IDbConnection>, Func<IDbConnection, T>)
View Source
Declaration
public static T DbContextExec<TApplicationDbContext, T>(this IServiceProvider services, Func<TApplicationDbContext, IDbConnection> dbResolver, Func<IDbConnection, T> fn)
Returns
<T>
Parameters
Type | Name |
---|---|
IServiceProvider | services |
Func<<TApplicationDbContext>,IDbConnection> | dbResolver |
Func<IDbConnection,<T>> | fn |
Type Parameters
TApplicationDbContext
T
GetIdentityUserRolesById(IDbConnection, String)
View Source
Declaration
public static List<string> GetIdentityUserRolesById(this IDbConnection db, string userId)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
GetIdentityUserRolesById(IDbConnection, String, String)
View Source
Declaration
public static List<string> GetIdentityUserRolesById(this IDbConnection db, string userId, string sqlGetUserRoles)
Returns
List<System.String>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
System.String | sqlGetUserRoles |
GetIdentityUserById(IDbConnection, String)
View Source
Declaration
public static Dictionary<string, object> GetIdentityUserById(this IDbConnection db, string userId)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
GetIdentityUserById(IDbConnection, String, String)
View Source
Declaration
public static Dictionary<string, object> GetIdentityUserById(this IDbConnection db, string userId, string sqlGetUser)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
System.String | sqlGetUser |
ToObjectDictionary(IDataReader, Func<String, Object, Object>)
View Source
Declaration
public static Dictionary<string, object> ToObjectDictionary(this IDataReader reader, Func<string, object, object> mapper = null)
Returns
Dictionary<System.String,System.Object>
Parameters
Type | Name |
---|---|
IDataReader | reader |
Func<System.String,System.Object,System.Object> | mapper |
GetIdentityUserById<T>(IDbConnection, String)
View Source
Declaration
public static T GetIdentityUserById<T>(this IDbConnection db, string userId)
Returns
<T>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
Type Parameters
T
GetIdentityUserById<T>(IDbConnection, String, String)
View Source
Declaration
public static T GetIdentityUserById<T>(this IDbConnection db, string userId, string sqlGetUser)
Returns
<T>
Parameters
Type | Name |
---|---|
IDbConnection | db |
System.String | userId |
System.String | sqlGetUser |
Type Parameters
T