Oskar Gewalli's blog articles

0
comment
on 1/27/2020 11:21 PM
In order to give a nicer developer experience composing validation messages there are broad categories of libraries that either work well in a Java/C# style setting or work well when composing functions. Attribute based validation libraries The default style that can be seen in many java and C# projects is the attribute based validation approach. public class Person { [MinLength(1,ErrorMessage ="NameBetween1And50"), MaxLength(50,ErrorMessage ="NameBetween1And50")] public string Name{get;set;} [Ema[...]
>> Read the full article
.
0
comment
on 1/26/2020 8:42 AM
Problems How do you create an instance of a given readonly class? How do you get a new instance but with given fields with different values? Writing readonly record classes 2007 Around 2007 I wrestled with writing immutable classes in c#. One of the key painpoints was that the constructor parameters for a class representing a database row for a specific table ended up with around 68 parameters. Note that we already had code generation of SQL Reader row deserialization based on SQL information tab[...]
>> Read the full article
.
0
comment
on 1/26/2020 8:42 AM
Problems How do you create an instance of a given readonly class? How do you get a new instance but with given fields with different values? Writing readonly record classes 2007 Around 2007 I wrestled with writing immutable classes in C#. One of the key painpoints was that the constructor parameters for a class representing a database row for a specific table ended up with around 68 parameters. Note that we already had code generation of SQL Reader row deserialization based on SQL information tab[...]
>> Read the full article
.
0
comment
on 12/28/2019 9:29 AM
After writing the previous posts about getting some of the infrastructure working for non Windows systems, I’ve seen better ways of getting it to work. Instead of using a netfx.props file, you can use a Directory.Build.props with platform specific configuration as seen in for instance FSharp.Compiler.Service: <Project> <!-- mono --> <PropertyGroup Condition="'$(OS)' == 'Unix'"> <MonoRoot Condition="'$(MonoRoot)' == '' and $([MSBuild]::IsOsPlatform('Linux'))">/usr</MonoRoot> <MonoRoot Conditio[...]
>> Read the full article
.
0
comment
on 12/28/2019 9:29 AM
After writing the previous posts about getting some of the infrastructure working for non Windows systems, I’ve seen better ways of getting it to work. Instead of using a netfx.props file, you can use a Directory.Build.props with platform specific configuration as seen in for instance FSharp.Compiler.Service: <Project> <!-- mono --> <PropertyGroup Condition="'$(OS)' == 'Unix'"> <MonoRoot Condition="'$(MonoRoot)' == '' and $([MSBuild]::IsOsPlatform('Linux'))">/usr</MonoRoot> <MonoRoot Conditio[...]
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper