changomarcelo wrote:
public static bool AccountExists(string name)
{
AccountCollection accounts = new AccountCollection();
IPredicateExpression filter = new PredicateExpression(AccountFields.Name == name);
return (accounts.GetDbCount(filter) == 1);
}
Hi Matt,
I don't understand what you mean, the original code snippet is not mine, it's from changomarcelo.
public static bool AccountExists(string name)
This method just check that the Name Field or any other Field exists in SomeEntity and return a bool value.
That's what this code does
bool returnValue = Enum.IsDefined(typeof(AccountFieldIndex), "Name");
and isn't what changomarcelo wants ?
Regards
Gianfranco