My application crashes with "DataPortal.Create failed (Invalid URI: The hostname could not be parsed.)" error.
After little debugging I've found the source of the exception. Exception occurs in "public RuleUri(string typeName, string propertyName)" constructor. My typeName has non-latin name. It has cyrillic name. And encoded "uriString" looks like this:
Uri is failed if char like '-' goes right after '.' (dot). If I will change above to this:
everythings is fine!
Why no one react on this bug? Do you need a sample of namespace?
Well, the question is, is it a bug in .NET or in CSLA?
And are there other parts affected as well?
For now - I have registered the issue in repository:
Well, I don't think that's a bug in Uri class. Uri has some format and that format don't like when char like '-' goes right after '.'.
For know I fix it like this:
var uriString = "rule://" + hostName + "/" + EncodeString(propertyName);
var uriString = "rule://" + hostName.Replace(".-", ".") + "/" + EncodeString(propertyName).Replace(".-", ".");
But I would like, CSLA could handle this situation by itself.
public abstract class Документ : BusinessBase<Документ>
I'm quite sure this also applies to query parameters to the URI like additional fields or maybe even values added to the RuleName.
But I am suspection there may be other areas affected as well.
I'm new to CSLA. So, I don't fully understand what are you talking about. For now, my test project goes fine.
If you need some cyrillic words for reproducing problem you can use this site for example:
Copyright (c) Marimer LLC