I am using Rulesets on a type that looks like this:
public class Salary
{
public decimal HourlyRate { get; set; }
[ValidHours] //Custom validator
public int NumHours { get; set; }
[VerifyValidState(Ruleset="State")] //Custom validator with ruleset
public string State { get; set; }
}
Due to business requirements, I'...
When I read rules from a configuration file, I do something like this:
IConfigurationSource configurationSource = new FileConfigurationSource("myvalidation.config");
var validator = ValidationFactory.CreateValidator<Salary>(configurationSource);
The config file looks like this:
<ruleset name="Default">
<properties>
<property na...
Hello,
What I am doing:
I am taking the Microsoft Enterprise Library 4.1 and attempting to expand upon it using a few derived classes.
I have created a MyLogEntry, MyFormatter, and MyTraceListener which derive from their respective base classes when you remove the "My" from their names.
What my problem is:
Everything compiles fine. Wh...
It's been ages since I last used Access as a back end but I'm being forced to. I'm using Enterprise Library 4.1, the Data Access Application Block.. with .NET 3.5 and I wanted to know the best way (code sample if possible) to write an insert query that will automatically give me the newly inserted auto-number back..or if it's not possibl...
I am trying to log a simple string to a log file.
I only need Category, message and timestamp.
Thus I have configured app.config like this:
<listeners>
<add name="Flat File Destination"
fileName="C:\Log\Phoenix.Common.Tests\Debug.log"
header="-----------------------------------------------------------------"
for...
I am using Unity with MVC and NHibernate. Unfortunately, our UnitOfWork resides in a different .dll and it doesn't have a default empty .ctor.
This is what I do to register NHibernate:
var connectionString = ConfigurationManager.ConnectionStrings
["jobManagerConnection"].ConnectionString;
var assemblyMap = ConfigurationManager.AppSe...
We're using the Enterprise Library Caching Application Block to do caching (in memory) in our web service. Works great, no complaints.
We're starting to do some load testing, and I've been asked to disable the cache so we can get some relative idea of what kind of performance gain caching gives us. I thought this would be simple - it ...
How can I prepare the configuration settings (App.config, maybe?) I need to use Enterprise Library Data Access Application Block in a C# console project?
Following is what I currently trying with an App.config in the console project. When I call DatabaseFactory.CreateDatabase(), it throws an exception which says:
"Configuration system ...
Hi all,
I have app.config in m win application, and loggingConfiguration section (enterprise library 4.1).
I need do this programatically,
Get a list of all listener in loggingConfiguration
Modify property fileName=".\Trazas\Excepciones.log" of several RollingFlatFileTraceListener's
Modify several properties of AuthenticatingEmai...
Hello
I have a project that uses the Enterprise Library 4.1. When I target .net 4 and compile, I get an error that says I need to add a reference to System.ServiceModel version 3. My reference is to System.ServiceModel version 4. How can I tell Visual Studio 2010 to reference a .net3 assembly from a .net3 project? Or, does somebody ...
We have to create a historical log of all the changed entities. we have defined our custom tables for this purpose. I have to incorporate this tables in Enterprise library logging block and do logging in these tables. I need to write a SP to insert values to these tables.
Till now,what i have got from google is that i have to create a l...
I'm using the Microsoft Logging Application Block (version 5 beta 2) and I'm trying to dynamically set the file name of a log file to the year month and day (and then write a new log file every day). However, at runtime, the logger ignores any dynamic environment variables such as %date%, %time%, or %cd%. I can add static environment va...
Hello to everybody.
I've found a very good article about how to use EntLib Validation Block for server validation in MVC 2.
But as there pointed out
The current design of EntLib’s Validation Application Block uses the Composite pattern; that is, when we ask for validation for an object, it returns back a single validator object that...
With Validation Application block, there's the following functionality:
Creating Custom attributes
Creating SelfValidation on the type
Ability to read from external config file
I plan to use the DataAnnotations to replace the Validation application block. Are the above possible with DataAnnotations? If so, how'd I implement them?
An...
Hi, I'm new to the validation application block and trying to use it with wcf...
I have a wcf service that has data objects with validation rules defined with attributes, using the validation application block .
On my client side (WPF), I have a service reference. When I update the service reference the generated classes do not have th...
I'm using MS EnterpriseLibrary.Logging and that works perfectly but the log file(s) are placed in the program executable directory.
How do I get it to place my log files in individual user's applicationData folder?
The folder I'm talking about is the one you get by calling:
Environment.GetFolderPath(Environment.SpecialFolder.Applicat...
Consider this piece of code:
public abstract class Validator
{
protected Validator()
{
}
protected abstract void ValidateCore(object instance, string value, IList<ValidationResult> results);
public void Validate(object instance, string value, IList<ValidationResult> results)
{
if (null == instance) t...
Can anyone point me to any useful examples of an application framework being built using the newly released Enterprise Library 5?
I have previously used v4.1 and after downloading the source for v5 and building - I'm not understanding how to integrate it with a WPF app - i.e. there doesn't appear to be any UnityBootstrapper class.
Than...
I am using Enterprise library 3.1 to log application logs in Windows event logs, and I want to read this log by passing the date parameter.
Please note that I will be accessing the remote machine and the performance should be good. Is there any method that can be used to read these logs using Ent Lib, or please suggest some good method....
I'm trying to write validation rules for my data objects in a WPF application. I'm writing them in the configuration file, and so far they are working fine.
I'm stumped on how to localize the messages using messageTemplateResourceName and messageTemplateResourceType. What I know is that the strings can be writen in a resource file, giv...