Skip to main content

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
TypeName
IServiceProviderservices
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
TypeName
IServiceProviderservices
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
TypeName
IDbConnectiondb
System.StringuserId

GetIdentityUserRolesById(IDbConnection, String, String)

View Source
Declaration
public static List<string> GetIdentityUserRolesById(this IDbConnection db, string userId, string sqlGetUserRoles)
Returns

List<System.String>

Parameters
TypeName
IDbConnectiondb
System.StringuserId
System.StringsqlGetUserRoles

GetIdentityUserById(IDbConnection, String)

View Source
Declaration
public static Dictionary<string, object> GetIdentityUserById(this IDbConnection db, string userId)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
IDbConnectiondb
System.StringuserId

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
TypeName
IDbConnectiondb
System.StringuserId
System.StringsqlGetUser

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
TypeName
IDataReaderreader
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
TypeName
IDbConnectiondb
System.StringuserId
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
TypeName
IDbConnectiondb
System.StringuserId
System.StringsqlGetUser
Type Parameters
  • T