C# Class GenericServices.GenericServicesConfig

This static class holds the GenericService configuration parts
Show file Open project: JonPSmith/GenericServices

Public Methods

Method Description
AddToSqlErrorDict ( int sqlErrorNumber, string errorText ) : void

This adds an entry to the SqlErrorDict

AddToSqlHandlerDict ( int sqlErrorNumber, HandleSqlException errorHandler, bool checkNotAlreadySet = true ) : void

This adds an ErrorHandler to the SqlHandlerDict The ErrorHandler will be called if the specified sql error happens. Note: will throw an exception if an error handler already exists for that sql error number unless the checkNotAlreadySet is set to false

ClearAutoMapperCache ( ) : void

This clears any AutoMapper mappings. Used when Unit Testing to ensure the mappings are newly set up.

ClearSqlErrorDict ( ) : void

This clears the SqlErrorDict of all entries

ClearSqlHandlerDict ( ) : void

This clears the SqlHandlerDict of all entries

Method Details

AddToSqlErrorDict() public static method

This adds an entry to the SqlErrorDict
public static AddToSqlErrorDict ( int sqlErrorNumber, string errorText ) : void
sqlErrorNumber int
errorText string
return void

AddToSqlHandlerDict() public static method

This adds an ErrorHandler to the SqlHandlerDict The ErrorHandler will be called if the specified sql error happens. Note: will throw an exception if an error handler already exists for that sql error number unless the checkNotAlreadySet is set to false
public static AddToSqlHandlerDict ( int sqlErrorNumber, HandleSqlException errorHandler, bool checkNotAlreadySet = true ) : void
sqlErrorNumber int
errorHandler HandleSqlException Called when given sql error number happens with sql error and entities. /// Should return ValidationError or null if cannot handle the error
checkNotAlreadySet bool
return void

ClearAutoMapperCache() public static method

This clears any AutoMapper mappings. Used when Unit Testing to ensure the mappings are newly set up.
public static ClearAutoMapperCache ( ) : void
return void

ClearSqlErrorDict() public static method

This clears the SqlErrorDict of all entries
public static ClearSqlErrorDict ( ) : void
return void

ClearSqlHandlerDict() public static method

This clears the SqlHandlerDict of all entries
public static ClearSqlHandlerDict ( ) : void
return void