CopyPastor

Detecting plagiarism made easy.

Score: 0.7964456677436829; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-02-14
by TanvirArjel

Original Post

Original - Posted on 2019-02-14
by Kristóf Tóth



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Do as follows:
var cookieName = Configuration.GetSection("SundrySettings:CookieName").Value; var accessGroup = Configuration.GetSection("SundrySettings:AccessGroup").Value; var terminals = Configuration.GetSection("SundrySettings:Terminals").GetChildren();
List<Terminal> terminalList = new List<Terminal>();
foreach (var keyValuePair in terminals) { Terminal termial = new Terminal() { Name = keyValuePair.Key, Description = keyValuePair.Value };
terminalList.Add(termial); }
SundryOptions sundryOption = new SundryOptions() { CookieName = cookieName, HRAccessGroup = accessGroup, Terminals = terminalList };
I have checked with the exact configuration you provided and it works perfectly.
Implement processing of configuration as following somewhere approporiate like this:
var cookieName = Configuration.GetSection("SundrySettings:CookieName").Value; var accessGroup = Configuration.GetSection("SundrySettings:AccessGroup").Value;
var terminals = new List<Terminal>()
var terminalSections = this.Configuration.GetSection("Terminals").GetChildren(); foreach (var item in terminalSections) { terminals.Add(new Terminal { // perform type mapping here }); }
SundryOptions sundryOption = new SundryOptions() { CookieName = cookieName, HRAccessGroup = accessGroup, Terminals = terminalList };
Of course there could be shorter version, but you can start from here.

        
Present in both answers; Present only in the new answer; Present only in the old answer;