Efcore: Format HasData in snapshot to multiple lines

Created on 15 Jun 2018  路  4Comments  路  Source: dotnet/efcore

```C#
b.HasData(
new
{
Id = new Guid("c6a32cba-c6ea-4597-955b-2ab76025dc7d"),
ConcurrencyStamp = "e2115b27-76d3-432e-bac4-541c2d96e5bd",
LockoutEnd = new DateTimeOffset(new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0))
});

Instead of
```C#
b.HasData(
    new { Id = new Guid("c6a32cba-c6ea-4597-955b-2ab76025dc7d"), ConcurrencyStamp = "e2115b27-76d3-432e-bac4-541c2d96e5bd", LockoutEnd = new DateTimeOffset(new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)) }
    );
closed-fixed good first issue help wanted type-enhancement

All 4 comments

@bricelam I can give this a shot if you want, let me know!

Awesome, go for it!

@bricelam @AndriySvyryd Which of the following outputs are correct?

Output 1:

b.HasData(
    new { Id = 42 },
    new
    {
        Id = 43,
        OptionalProperty = 4.3m
    });

Output 2:

b.HasData(
    new
    {
        Id = 42
    },
    new
    {
        Id = 43,
        OptionalProperty = 4.3m
    });

Our main goal is to make that file diff well for when there's a merge conflict. Given that, I'd say option 2.

Was this page helpful?
0 / 5 - 0 ratings