You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using fluent methods with different levels of semantic meaning, it can be difficult to maintain good readability with CSharpier currently, since it doesn't know the semantic difference between two fluent method calls.
Here's a tiny example of using a FluentMappingBuilder from Linq2Db to setup
Input:
// example from Linq2Db's FluentMappingBuilder
builder
.Entity<Authors>().HasTableName("authors").Property(x => x.Id).HasColumnName("Id").IsIdentity().IsPrimaryKey().Property(x => x.Name).HasColumnName("Name").IsNotNull().Entity<Book>().HasTableName("books").Property(x => x.Id).HasColumnName("Id").IsIdentity().IsPrimaryKey().Property(x => x.Name).HasColumnName("Name").IsNotNull().Property(x => x.AuthorId).HasColumnName("AuthorId").IsNotNull().Build();
But the issue is how we can teach CSharpier about the significance of calling Entity<>() vs for example calling Property() or HasColumnName().
I was thinking that maybe a comment-style approach similar to how // csharpier-ignore currently works might be a good solution.
E.g. something like this to apply to level-rules to current scope:
This is kind of an advanced feature, and probably more thought would have to go into it for it to become really good, but I'm submitting now to start the discussion.
Thoughts?
The text was updated successfully, but these errors were encountered:
When using fluent methods with different levels of semantic meaning, it can be difficult to maintain good readability with CSharpier currently, since it doesn't know the semantic difference between two fluent method calls.
Here's a tiny example of using a
FluentMappingBuilder
from Linq2Db to setupInput:
Output:
Expected behavior:
But the issue is how we can teach CSharpier about the significance of calling
Entity<>()
vs for example callingProperty()
orHasColumnName()
.I was thinking that maybe a comment-style approach similar to how
// csharpier-ignore
currently works might be a good solution.E.g. something like this to apply to level-rules to current scope:
This is kind of an advanced feature, and probably more thought would have to go into it for it to become really good, but I'm submitting now to start the discussion.
Thoughts?
The text was updated successfully, but these errors were encountered: