Reporter | Alex Berezoutsky (fergard) |
---|---|
Created | Feb 16, 2012 7:59:56 PM |
Updated | Feb 17, 2012 11:10:29 AM |
Priority | Critical |
Type | Bug |
Fix versions | Next |
State | Submitted |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | No subsystem |
Affected versions | 6.1.1 |
Fixed in build | No Fixed in build |
I have the following code in a builder class:
The new keyword for the new HashlogBuilder suggests to use an object initializer. However when applied, this looses the additional line which adds a new folder:
public HashLogBuilder WithFolder(string folder, string extension, bool recursive) { var builder = new HashLogBuilder(); builder._folders = new List<FolderDescription>(_folders); builder._folders.Add(new FolderDescription{Folder = folder, Extension = extension, Recursuve = recursive}); builder._bytes = _bytes; return builder; }
The new keyword for the new HashlogBuilder suggests to use an object initializer. However when applied, this looses the additional line which adds a new folder:
public HashLogBuilder WithFolder(string folder, string extension, bool recursive) { var builder = new HashLogBuilder {_folders = new List<FolderDescription>(_folders), _bytes = _bytes}; return builder; }