Clean Coder

Results 14 comments of Clean Coder

Namespace wide type aliases are especially useful when using generic type arguments I have hundreds occasions of IFoo{int} What if I choose to use Guid or long instead? I have...

The compiler could detect if there is a already a private member with same name as the param name and enforce the user to either prefix its methodname => nameof(Method1.Param1)...

As of NET 6 Preview 6 I get an error using EF Core mapping DateOnly properties stating that the DB Provider (SQL Server) does not support this type. Is it...

As already discussed there, it's not supported. What's the common workaround? `builder.Properties().HaveConversion(typeof(DateTime));` does not do the trick. If possible at all, do I need to write a custom Converter/Comparer to...

> @CleanCodeX there isn't anything built-in for SQL Server, you'll have to implement your own value converter. So I did. In case anyone has the same problem: This seems to...

Yeah of course the the properties needed to be marked as date / time sql type (or with fluent api). I thought that would be clear then. My mistake if...

sadly the above solution does not work anymore with RC2 for **Nullable** DateOnlys/TimeOnlys ```csharp protected sealed override void ConfigureConventions(ModelConfigurationBuilder builder) { builder.Properties() .HaveConversion() .HaveColumnType("date"); builder.Properties() .HaveConversion() .HaveColumnType("date"); } ``` I...

"But are these ValueComparer Implementations really necessary, since DateOnly already implements IComparable itself?" No, you can completely leave them out as the following code shows. I did not see in...

I find this apporach very useful. I don't care if it is const var or just const alone.

My favorite ist just const with ommitting its type. const acts as var in that way. const var seems to me to long for something const without type can do...