I gang

C# - Collection Validator Library

The aim of this project is to build a simple open source library to validate collections of objects. It can incorporate open source solutions such FluentValidation and the likes, and must be fully unit tested and follow stylecop standards.

I intend to make this project open source once it is complete. The best way to describe this project is by an example.

The way I would like to use this library would be like this (The code below is only intended to give you an idea of what I am after.):

var stringCollection = new List();

// Add some strings to the list here.

CollectionValidator myStringCollectionValidator = new CollectionValidator();

[url removed, login to view]().CountGreaterThan(3).CountLessThan(10);

var collectionValidationResults = [url removed, login to view](stringCollection);

For a collection of objects which is made up of multiple fields:

class myObject


public int ID {get;set;}

public string FirstName {get;set;}

public string LastName {get;set;}


var myObjectCollection = new List();

// Add some myObjects to the collection

// The myObjectValidator will validate each myObject in the collection.

CollectionValidator myObjectCollectionValidator = new CollectionValidator(myObjectValidator);

[url removed, login to view](x => [url removed, login to view]).Unique(x => [url removed, login to view], x => [url removed, login to view]).CountGreaterOrEqualTo(3);

var collectionValidationResults = [url removed, login to view](myObjectCollection);

The Unique() test will be overloaded to accept a variable or not. If it does not accept a variable it will simply check that all objects in the collection are unique. If it finds a duplicate, the index will be recorded.

If the Unique() test accepts a variable then the Property or the field of the Object needs to be checked for uniqueness.

If you have any questions please feel free to ask.

Evner: .NET, C# Programmering, Ingeniørarbejde, Software Arkitektur, Software Testning

Se mere: validator example, string library in c, string library c, c list library, simple library, simple collection, multiple fields, stylecop, unit class, library free, class library project, net simple class, simple string class, simple project collection, multiple questions net, class library, validator, best collection, multiple likes, open source solutions, net objects, validate net, free project list net, intend list property, free open code net

Om arbejdsgiveren:
( 61 bedømmelser ) Other, Australia

Projekt ID: #4036488